2

MahApps.Metro プロジェクトを使用しているときに、WPF でリストボックスの交互の行の色を作成しようとしています。スタイルとトリガーを追加しても、すべてのアイテムの背景はまだ白です。

        <Style TargetType="ListBox">
            <Setter Property="AlternationCount" Value="2" />
            <Style.Triggers>
                <Trigger Property="ItemsControl.AlternationIndex" Value="1">
                    <Setter Property="Background" Value="Blue" />
                </Trigger>
            </Style.Triggers>
        </Style>
4

1 に答える 1