代码之家  ›  专栏  ›  技术社区  ›  TomTom

拆分generic.xaml-加载合并集时出现问题。请帮助来源

  •  6
  • TomTom  · 技术社区  · 15 年前

    在一个相当大的控件库中工作generic.xaml会失去控制。我想通过控制来分割它(尽管对于目前只包含一些简单名称空间的名称空间来说,只需要一次)。

    为此,我正在添加更多的资源字典。

    然后,在generic.xaml中添加:

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Themes/Generic.Core.xaml" />
    </ResourceDictionary.MergedDictionaries>
    

    还有…获取加载错误。

    正确的URL是什么?

    这是:

    • 在仅包含控件(而不是exe或其他控件)的dll文件中。
    • generic.xaml和另一个(目前为generic.core.xaml)位于同一程序集、同一文件夹中。

    我阅读了有关包URL的msdn部分,但对于看起来如此简单的内容来说,这听起来非常复杂。

    请帮助。

    1 回复  |  直到 7 年前
        1
  •  13
  •   devpelux    7 年前

    找到它:

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Tradex.Presentation;component/Themes/Generic.Core.xaml" />
    </ResourceDictionary.MergedDictionaries>
    

    那是有效的。
    需要给程序集加前缀(替换 Tradex.Presentation 以程序集名称)并以 component 项目。

    推荐文章