私はIsSelectionActive
WPF DataGridで作業しようとしています:
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<ContentPresenter />
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelectionActive" Value="False" />
<Condition Property="IsSelected" Value="True" />
<!--<Condition Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGridRow}}, Path=IsSelected}" Value="True" />
<Condition Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}, Path=IsKeyboardFocusWithin}" Value="True" />-->
</MultiTrigger.Conditions>
基本的に、グリッドのフォーカスが失われているが、選択範囲がまだ残っている場合は、スタイリングを適用したいと考えています。
残念ながら、IsSelectionActive
何らかの理由で WPF データ グリッドに存在しないというエラーがスローされます。