在这些情况下如何获得上级控制作为源。TextBlock 需要在工具提示上访问。
<Style TargetType="{x:Type Control}" x:Key="ErrorTemplate">
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="True">
<Setter Property="ToolTip">
<Setter.Value>
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="1" Margin="4, 0,0,0" Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ToolTip}, Path=(Validation.Errors)[0].ErrorContent}"></TextBlock>
</Grid>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>