Этот тег XAML не работает:
<Label Content="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}" />
в этом коде XAML:
<Style x:Key="textBoxStyle" TargetType="{x:Type TextBox}">
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="True">
<Setter Property="Background" Value="Red"/>
<!--<Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}" />-->
<Setter Property="ToolTip">
<Setter.Value>
<StackPanel Orientation="Vertical">
<Label Background="AliceBlue" Content="Input Error"/>
<Label Content="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}" />
</StackPanel>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
Я хочу передать (Validation.Errors) [0] .ErrorContent данные TextBox в свойстве Label внутри ToolTip