我在项目模板中有文本框,如下所示。
<HierarchicalDataTemplate.ItemTemplate>
<DataTemplate>
<WrapPanel Margin="2" >
<CheckBox IsHitTestVisible="false"
IsChecked="{Binding Status}"
Style="{StaticResource ResourceKey=TreeView_CheckBox_Style}" Visibility="Collapsed"></CheckBox>
<TextBox Text="{Binding Name, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Background="Transparent"
IsReadOnly="True"
BorderThickness="0" TextWrapping="Wrap"
MouseDoubleClick="TextBox_MouseDoubleClick"
LostFocus="TextBox_LostFocus"
Style="{StaticResource ResourceKey=ValidationErrorStyle}" >
</TextBox>
</WrapPanel>
</DataTemplate>
</HierarchicalDataTemplate.ItemTemplate>
我的验证风格是
<Style TargetType="TextBox" BasedOn="{StaticResource ResourceKey=TextBoxStyle}" >
<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>
但是我的验证触发器没有触发上述设置。有什么帮助吗?我在这里缺少什么?