I want my TextBox to have a red background if the ViewModel = " invalid " property . What do I need to change for this to work?
This version tells me that Background does not have a qualification type name .
<TextBox
Width="200"
Text="{Binding FieldEmail, UpdateSourceTrigger=PropertyChanged}">
<TextBox.Triggers>
<DataTrigger Binding="{Binding FieldEmailValidationStatus}" Value="invalid">
<Setter Property="TextBox.Background" Value="Tomato"/>
</DataTrigger>
</TextBox.Triggers>
</TextBox>
When I add a "TextBox". this tells me that I should have an EventTrigger :
<TextBox
Width="200"
Text="{Binding FieldEmail, UpdateSourceTrigger=PropertyChanged}">
<TextBox.Triggers>
<DataTrigger Binding="{Binding FieldEmailValidationStatus}" Value="invalid">
<Setter Property="Background" Value="Tomato"/>
</DataTrigger>
</TextBox.Triggers>
</TextBox>
source
share