In my WPF control, I have the following two triggers:
<Trigger
Property="Controls:TreeViewExItem.IsMouseOver"
Value="True"
SourceName="ElementGrid">
and
<DataTrigger
Binding="{Binding
RelativeSource={RelativeSource AncestorType={x:Type Controls:TreeViewEx}},
Path=HoverHighlighting}"
Value="False">
Both for themselves work fine. But I need a combination of these. I tried this:
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition
Binding="{Binding
RelativeSource={RelativeSource AncestorType={x:Type Controls:TreeViewEx}},
Path=HoverHighlighting}"
Value="True"/>
<Condition
Binding="{Binding
(Controls:TreeViewExItem.IsMouseOver),
Source=ElementGrid}"
Value="True"/>
</MultiDataTrigger.Conditions>
But it does nothing. I get this message in the output window:
System.Windows.Data Error: 17 : Cannot get 'IsMouseOver' value (type 'Boolean') from '' (type 'String'). BindingExpression:Path=(0); DataItem='String' (HashCode=1047858601); target element is 'TreeViewExItem' (Name=''); target property is 'NoTarget' (type 'Object') InvalidCastException:'System.InvalidCastException: Das Objekt des Typs "System.String" kann nicht in Typ "System.Windows.DependencyObject" umgewandelt werden.
That doesn't tell me anything. How will it work?
Update: The complete project code is now available in my GitHub repository for review. My guesswork of a MultiDataTrigger is currently located at.