开发者

Value is out of Range Exception While setting ResourceDictionary Source to CustomControl's generic.XAML

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 :

x开发者_StackOverflowmlns: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]


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜