1

This is my Multitrigger:

<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding Path=Dringlichkeit, RelativeSource={RelativeSource Self}}" Value="Normal"/>
        <Condition Property="ItemsControl.AlternationIndex" Value="0"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="Background" Value="LightPink"/>
</MultiDataTrigger>
<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding Path=Dringlichkeit, RelativeSource={RelativeSource Self}}" Value="Normal"/>
        <Condition Property="ItemsControl.AlternationIndex" Value="1"/>
    </MultiDataTrigger.Conditions>
    <Setter Property="Background" Value="Pink"/>
</MultiDataTrigger>

If I use this trigger as a DataTrigger, the binding works.

But I need the AlternationIndex. I thought it was because I was loading the data via SQL, but when I load the style after SQL, I still have the problem that the binding has a NULL value.

4

1 回答 1

0

从文档中我可以读到您应该AlterationIndex这样参考:
{Binding RelativeSource={RelativeSource Self}, Path=(ItemsControl.AlternationIndex)}
MSDN Doc
HTH

于 2016-10-17T10:15:34.960 回答