我有一个组合框,需要编辑它的错误模板以在出现验证错误时显示红色边框。WPF Combobox Validation.ErrorTemplate错误
我使用下面的风格
<Style TargetType="{x:Type ComboBox}" >
<Setter Property="Validation.ErrorTemplate">
<Setter.Value>
<ControlTemplate>
<DockPanel>
<Border BorderBrush="Red" BorderThickness="3">
<AdornedElementPlaceholder />
</Border>
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontSize" Value="12" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
时发生的验证错误的边界一直没有出现。任何提示有什么问题?
有意思的是,不如Blend是在让我们直观地编辑模板,似乎很难或许不可能在Blend中编辑'ErrorTemplate'。 – 2013-04-04 12:45:56