在用户控件库使用全局的ResourceDictionary [英] Using a global ResourceDictionary in a UserControl Library

查看:656
本文介绍了在用户控件库使用全局的ResourceDictionary的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经有A计划与App.xaml中

 <MyResourceDictionary.xaml的应用。资源> 

<&ResourceDictionary中GT;
< ResourceDictionary.MergedDictionaries>
< ResourceDictionary中源=MyResourceDictionary.xaml/>
< /ResourceDictionary.MergedDictionaries>
< / ResourceDictionary的>

< /Application.Resources>



我想在我的用户控件库也使用MyResourceDictionary.xaml - 项目B



我能做到这一点?



谢谢,
埃蒙·


< DIV CLASS =h2_lin>解决方案

查看包URI语法。是这样的:

 < ResourceDictionary中源=项目B;组件/ MyResourceDictionary/> 


I have have "Project A" with "MyResourceDictionary.xaml" in "App.xaml"

<Application.Resources>

    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="MyResourceDictionary.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>

</Application.Resources>

I want to also use "MyResourceDictionary.xaml" in my user control library - "Project B"

Can I do this?

Thanks, Eamonn

解决方案

Check out the pack URI syntax. Something like:

<ResourceDictionary Source="ProjectB;component/MyResourceDictionary"/>

这篇关于在用户控件库使用全局的ResourceDictionary的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆