I am trying to configure static resources for different states in my business objects. The idea is that I can use a value converter to take a business object and return the corresponding background brush, depending on the algorithm. I would like the resources to be static, so I can design them in the designer and switch manually to see how it will look during development, but be able to use them programmatically.
The goal is to have something in this direction:
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
var data = value as DummyData;
if (data == null)
return null;
if (data.VarianceAmount >= 0)
return StaticResources.HighBackground;
else
return StaticResources.LowBackground;
}
page/control/framework , ? DependencyObject, , .