Change your line of code to
var solidColorBrush = new SolidColorBrush((Color) ColorConverter.ConvertFromString("Red"));
DummyWrapper<Brush> dw = new DummyWrapper<Brush>(solidColorBrush);
cp.Content = (Brush)dw;
You don't want to use converters
that's fine. Content
is an object and doing an implicit operator will not just do that unless the Content
is of type Brush
. You have to explicitly cast it to Brush
System.Object
is the type of the Content property. Through inheritance there's already an implicit conversion to the base type