我正在将此样式应用于infragistics
控件XamDateTimeEditor
。新的错误图标按预期显示。
问题:发生验证错误时仍显示原始错误样式。从而使控件具有两种错误图标样式。
<Style TargetType="{x:Type XamDateTimeEditor}">
<Setter Property="Validation.ErrorTemplate">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Control}">
<DockPanel>
<Border
Background="Red"
Width="25"
Height="25"
CornerRadius="10"
>
<TextBlock
Text="Error"
VerticalAlignment="Center"
HorizontalAlignment="Center"
FontWeight="Bold"
Foreground="White"
/>
</Border>
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>