views:

142

answers:

1

Hi,

I have a custom Control which contains the generic.xaml inside the Themes folder. I have set the build action to Resource.

Now from App.xaml I am setting the reference to the DLL by using :

xmlns:localFolder="clr-namespace:customControl;assembly=customControl"

After the reference is set I am trying to Merge the Resource dictionary in my App.xaml as follow:

<Application.Resources>

        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="localFolder;component/Themes/generic.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>

</Application.Resources>

But while running my application I am getting the following XAMLParseException:

Attribute localFolder;component/Themes/generic.xaml value is out of range. [Line: 16 Position: 44]
+1  A: 

Source should be in the Uri format - /assembly-name;component/path-to-resource. You can't define an XML namespace with xmlns:localFolder="..." and then use it in the URI string. Here is some reading on the accepted formats.

Igor Zevaka