I want my TextBox to have a red background if the ViewModel property = "invalid". What do I have to change so this works?
This version tells me that Background does not have a qualifying 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 "TextBox." it tells me I have to 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>
TargetType="TextBox"
to the<Style>
tag – Fda