title: How can I combine a Trigger with a SourceName and a DataTrigger?
body: <p>In my WPF control, I have the following two triggers:</p>
  
  <pre><code>&lt;Trigger
    Property="Controls:TreeViewExItem.IsMouseOver"
    Value="True"
    SourceName="ElementGrid"&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;DataTrigger
    Binding="{Binding
      RelativeSource={RelativeSource AncestorType={x:Type Controls:TreeViewEx}},
      Path=HoverHighlighting}"
    Value="False"&gt;
  </code></pre>
  
  <p>Both for themselves work fine. But I need a combination of these. I tried this:</p>
  
  <pre><code>&lt;MultiDataTrigger&gt;
    &lt;MultiDataTrigger.Conditions&gt;
      &lt;Condition
        Binding="{Binding
          RelativeSource={RelativeSource AncestorType={x:Type Controls:TreeViewEx}},
          Path=HoverHighlighting}"
        Value="True"/&gt;
      &lt;Condition
        Binding="{Binding
          (Controls:TreeViewExItem.IsMouseOver),
          Source=ElementGrid}"
        Value="True"/&gt;
    &lt;/MultiDataTrigger.Conditions&gt;
  </code></pre>
  
  <p>But it does nothing. I get this message in the output window:</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>That doesn't tell me anything. How will it work?</p>
  
  <p><strong>Update:</strong> The complete project code is now available in my GitHub repository for review. My guesswork of a MultiDataTrigger is currently located <a href="https://github.com/dg9ngf/TreeViewEx/blob/master/TreeViewEx/Themes/TreeViewExItem.xaml#L270" rel="nofollow">at</a>.</p>