0
への結合、私は検証エラーとツールチップを作成するためのスタイルトリガを持っている:最後の検証エラー
<Trigger Property="Validation.HasError" Value="true">
<Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self},
Path=(Validation.Errors)[0].ErrorContent}"/>
<Setter Property="Validation.ErrorTemplate">
<Setter.Value>
<ControlTemplate>
<DockPanel>
<Border BorderBrush="Red" BorderThickness="2" CornerRadius="2" Background="{x:Null}">
<AdornedElementPlaceholder/>
</Border>
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
私は[0] .ErrorContentを)最初のエラー(Validation.Errors)を表示していますが、私はしたいです最後のものを表示する(最後の方が優先され、フレームワークのテキストボックスは最後に検証エラーを追加します。例えば、日付を表さない文字列)。
ありがとうございました。
ありがとう、ありがとう.. – Poeta