I want to replace the normal behaviour of Validation.ErrorTemplate. I want to put a background border object (filled with red color) behind my own UserControl and then apply a simple color animation to blink it.
I tried this in my implicit control style:
<Style TargetType="{x:Type local:myControl}">
<Setter Property="Validation.ErrorTemplate">
<Setter.Value>
<ControlTemplate>
<Border Name="ErrorBorder" CornerRadius"5" Background="Red">
<AdornedElementPlaceholder />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="True">
<Setter Property="ToolTip" Value="{Binding
RelativeSource={RelativeSource Self},
Path=(Validation.Errors)[0].ErrorContent}" />
</Trigger>
</Style.Triggers>
</Style>
Unfortunately the border object entirely overlays the control UI. The other question is: where is the right place to put a DoubleAnimation applied on Opacity to make my Background blinking? Wich property/event should I trigger? Should I use style or simply place it in the Border.Triggers?
Thank you