Using Path=. and Converter inside Binding
<p>I have trouble defining a trigger for TreeViewItems. I believe it is just some syntax problem, but I don't know what else to write...</p>

<p>This is the Trigger:</p>

<pre><code>&lt;DataTrigger Binding="{Binding Path=., Converter=IsNodeConverter}" Value="True"&gt;
    &lt;Setter Property="Focusable" Value="False"/&gt;
&lt;/DataTrigger&gt;
</code></pre>

<p>Since it is defined inside <code>TreeView.ItemContainerStyle</code>, the <code>DataContext</code> should be the contained item itself. The Item can either be of type <code>Node</code> or <code>Entry</code> and I want to trigger for all Items that are of type <code>Node</code>. So I wrote a converter:</p>

<pre><code>public class IsNodeConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value is Node)
            return true;

        return false;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}
</code></pre>

<p>Which returns <code>true</code> if it gets a <code>Node</code> as input and <code>false</code> otherwise.</p>

<p>But in the part <code>Binding="{Binding Path=., Converter=IsNodeConverter}"</code> the compiler complains: "IValueConverter cannot convert from string." (original: "Vom TypeConverter-Objekt für IValueConverter wird das Konvertieren aus einer Zeichenfolge nicht unterstützt.") I don't understand this at all: DataContext is an object of type <code>Entry</code> or <code>Node</code>, and <code>Binding Path=.</code> should keep it that way. <strong>So what is the problem? What string is the compiler talking about? How do I correct this so that the compiler does not complain?</strong></p>

<p>Here is the full code of the TreeView for reference. The collection ´AllNodesAndEntries´ is an <code>ObservableCollection&lt;object&gt;</code> that contains both <code>Node</code>s and <code>Entry</code>s.</p>

<pre><code>&lt;TreeView ItemsSource="{Binding AllNodesAndEntries}"&gt;
    &lt;TreeView.Resources&gt;
        &lt;HierarchicalDataTemplate ItemsSource="{Binding Children}" DataType="{x:Type usrLibVM:Node}"&gt;
            &lt;TextBlock Text="{Binding Name}" Background="LightBlue"/&gt;
        &lt;/HierarchicalDataTemplate&gt;
        &lt;DataTemplate DataType="{x:Type usrLibVM:Entry}"&gt;
            &lt;TextBlock Text="{Binding Name}" Background="LightSalmon"/&gt;
        &lt;/DataTemplate&gt;
    &lt;/TreeView.Resources&gt;
    &lt;TreeView.ItemContainerStyle&gt;
        &lt;Style TargetType="{x:Type TreeViewItem}"&gt;
            &lt;Style.Triggers&gt;
                &lt;DataTrigger Binding="{Binding Path=., Converter=IsNodeConverter}" Value="True"&gt;
                    &lt;Setter Property="Focusable" Value="False"/&gt;
                &lt;/DataTrigger&gt;
            &lt;/Style.Triggers&gt;
        &lt;/Style&gt;
    &lt;/TreeView.ItemContainerStyle&gt;
&lt;/TreeView&gt;
</code></pre>