Did I miss something?
1- Style
<Style TargetType="{x:Type TextBox}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=Validation.HasError}" Value="true"> <Setter Property="BorderBrush" Value="Blue" /> </DataTrigger> </Style.Triggers> <Setter Property="MinWidth" Value="160" /> <Setter Property="Margin" Value="0 7 0 0"/> </Style>
2 - Viewmodel implements IDataErrorInfo 3- text field of view
<TextBox x:Name="FirstName" Text="{Binding Person.FirstName, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=true}"></TextBox>
3 - I am using Caliburn MVVM
I encountered a BindingExpression path error: the "Validation" property was not found in the "object" "PersonWindowViewModel" (HashCode = 38783181). "BindingExpression: Path = Validation.HasError; DataItem = 'PersonWindowViewModel' (HashCode = 38783181); target element is" TextBox "(Name =" FirstName "); target property -" NoTarget "(type" Object ")" S
wpf mvvm caliburn idataerrorinfo
user39880
source share