I got the code below, in which I'm interested to know whether the second binding (of the second condition of the trigger
) has its binding object created when the TreeViewItem
is loaded? or only if the first condition
was True?
<Style TargetType="TreeViewItem">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
Value="True"/>
<Condition Binding="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType=TreeView}, Path=DataContext.IsConfigurationAttributeEnabled}"
Value="True"/>
</MultiDataTrigger.Conditions>
<Setter Property="Foreground"
Value="Aqua"/>
</MultiDataTrigger>
</Style.Triggers>
</Style>
Let's guess we have a DataGrid
and each cell has something like 5 MultiDataTrigger
s with 4 conditions in each one of it. The most of the multi data triggers will fail at the first condition (bounded to some system property with Mode=OneTime). In such case I think it's a bit heavy that each cell creates so much bindings objects in vain. Or maybe it's not that critical because we have virtualization and paging?