Hopefully this should be an easy one, i have a background of a rectangle i want to display as the phone accent colour or a disabled color based on a boolean in my view model.
I assume that converters are the way to go, but not sure of the syntax to get access to the static resources.
<Rectangle.Fill>
<SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
</Rectangle.Fill>
Grab the code for a generic
BoolToValueConverterfrom this blog article:-A Generic Boolean Value Converter
Also include in your code this specialisation for a converter to a Brush:-
Now add the converter to your Xaml like this:-
Then in rectangle :-
This assumes the property in your view model is called
Disabled.