Return a dynamic resource from a converter
I want to change the color of a WPF control depending on the state of a bool, in this case the state of a checkbox. This works fine as long as I'm working with StaticResources: My control <TextBox Name="WarnStatusBox" TextWrapping="Wrap" Style="{DynamicResource StatusTextBox}" Width="72" Height="50" Background="{Binding ElementName=WarnStatusSource, Path=IsChecked, Converter={StaticResource BoolToWarningConverter}, ConverterParameter={RelativeSource self}}">Status</TextBox> My converter: [ValueConversion(typeof(bool), typeof(Brush))] public class BoolToWarningConverter : IValueConverter {