Recently hit a WPF issue with IDataErrorInfo where using ValidatesOnDataErrors with a TextBox creates a border around the textbox that doesn’t go away when used with an Expander. Screen shot below before closing expander:
Screenshot after closing expander:
The workaround? Create a style for Textbox (or TextboxBase, depending) which blows away the validation error template like this:
<Setter Property="Validation.ErrorTemplate" Value="{x:Null}"/>
And then manually sets the border, like this:
<Setter Property="ToolTip"
Value="{Binding RelativeSource={x:Static RelativeSource.Self},
Path=(Validation.Errors)[0].ErrorContent}"/>
<Setter TargetName="Border" Property="Background" Value="Red"/>
</Trigger>
That did the trick. Download a complete sample of the fix.