I have a DockPanel that is composed of a button and a textbox. These controls are enclosed by a border. Now I would like to validate the textbox and change the color of the border if the validation fails.
However, in my current application, the validation only affects the textbox itself.
<Border>
<DockPanel>
<Button Command="{Binding GetFolder}">
<Button.Template>
<ControlTemplate>
<Image Source="/Assets/Icons/Folder.png"/>
</ControlTemplate>
</Button.Template>
</Button>
<TextBox
Text="{Binding
Path=DataFolder,
ValidatesOnDataErrors=True,
Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged,
NotifyOnSourceUpdated=True}">
</TextBox>
</DockPanel>
</Border>
I know that I can give the Border an ErrorTemplate:
<Border Validation.ErrorTemplate="{StaticResource errorTemplate}">...,
But how do I tell it the result of the validation of the textbox?