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

namespace QC.QTMApplication;

public class StringToBrushConverter : IValueConverter
{
	public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
	{
		Color color = Colors.Black;
		if (value is string)
		{
			color = (Color)ColorConverter.ConvertFromString(value.ToString());
		}
		return new SolidColorBrush(color);
	}

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