public class ColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if ((bool)value)
return null;
else
{
string[] split = ((string)parameter).Split('|');
string colorToReplace = split[0];
string colorReplace = split[1];
return new Dictionary<string, string>
{
{ colorToReplace, colorReplace }
};
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}