using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;

namespace BeWo.Converter
{
	public class StringBrushConverter : IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			var lColor = value as string;

			return lColor == null ? null : new SolidColorBrush((Color) ColorConverter.ConvertFromString(lColor));
		}

		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			throw new NotImplementedException();
		}
	}
}