I try to convert simple string
and add markup string
for example:
Value is: bla bla
into: Value is <Span Foreground="Red">bla bla</Span>
So i want to use MultiValueConverter
and add simple converter (so far without any implementation):
public class StatusConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
Window.Resources:
<my:StatusConverter x:Key="StatusConverterToColor"/>
Usage:
<TextBlock Text="{Binding Status, Converter={StaticResource StatusConverterToColor}}" />
But got this error:
{"Unable to cast object of type 'MyApplication.classes.StatusConverter' to type 'System.Windows.Data.IValueConverter'."}
What i am doing wrong ?