a を使用して親のRelativeSource
Binding
を取得できると思います。私はあなたの XAML を持っていないので、あなたが何をしているのかを正確に知ることは困難です。AlternationIndex
ItemsControl
<ItemsControl
ItemsSource="{Binding Items}"
AlternationCount="2">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type vm:Item}">
<Grid>
<Grid.Style>
<Style TargetType="Grid">
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContentPresenter}}, Path=(ItemsControl.AlternationIndex)}" Value="0">
<Setter Property="Background" Value="Red"/>
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContentPresenter}}, Path=(ItemsControl.AlternationIndex)}" Value="1">
<Setter Property="Background" Value="Blue"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>