Normally when we provide this kind of validation in WPF, we set the NotifyOnValidationError
property to True
on the Binding
object. Try this:
<TextBox Text="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,
NotifyOnValidationError=True}" Background="Transparent" IsReadOnly="True"
BorderThickness="0" TextWrapping="Wrap" MouseDoubleClick="TextBox_MouseDoubleClick"
LostFocus="TextBox_LostFocus" Style="{StaticResource ResourceKey=
ValidationErrorStyle}" />