Background is of type Brush
but you are returning String
from converter. Return brush instance instead:
return new SolidColorBrush(Colors.Blue);
Replace all other instances to return SolidColorBrush
.
UPDATE
I have seen some strange corners where IValueConverter
works but doesn't work with IMultiValueConverter
. Multi-value converters need to return same type as that of target property.
Even when you bind Width
with IValueConverter and return 100 from it, it will work fine. But try returning 100
from IMultiValueConverter, it won't work unless you changed it to 100.0
because width is of type double.
I guess with IValueConverter type conversion is handled by WPF binding engine but not the case with IMultiValueConverter.