Wpf Resource: "Unknown Build Error, 'Path cannot be null..."

Posted by Femaref on Stack Overflow See other posts from Stack Overflow or by Femaref
Published on 2010-05-14T01:30:41Z Indexed on 2010/05/14 1:34 UTC
Read the original article Hit count: 575

Filed under:
|
|

The following is a snippet from a xaml defining a DataGrid in a Control, defining a template selector.

<DataGrid.Resources>
    <selector:CurrencyColorSelector x:Key="currencyColorSelector">
        <selector:CurrencyColorSelector.NegativeTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding Balance, StringFormat=n}" Background="Red"/>
            </DataTemplate>
        </selector:CurrencyColorSelector.NegativeTemplate>
        <selector:CurrencyColorSelector.NormalTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding Balance, StringFormat=n}"/>
            </DataTemplate>
        </selector:CurrencyColorSelector.NormalTemplate>
    </selector:CurrencyColorSelector>
</DataGrid.Resources>

Now, an error is thrown: "Unknown build error, 'Path cannot be null. Parameter name: path Line 27 Position 79.'" (Compiler or xaml validation error).

I have no idea where this Path comes from, neither does my example show anything of it. If you doubleclick the error, it points to the end of the first line.

Did anybody encounter such a problem and has a solution for it? The example was from here: http://www.wpftutorial.net/DataGrid.html (Row Details depending on the type of data)

© Stack Overflow or respective owner

Related posts about wpf

Related posts about xaml