【问题标题】:Splitting Generic.Xaml - problem loading MergedDictionaries拆分 Generic.Xaml - 加载 MergedDictionaries 时出现问题
【发布时间】:2010-07-21 06:39:41
【问题描述】:

处理一个相当大的控件库,generic.xaml 变得简单失控。我想通过控制来拆分它(虽然曾经是一个名称空间,现在只包含一些简单的名称空间)。

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

然后,我在 generic.Xaml 中添加:

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

并且...收到加载错误。

正确的网址是什么?

这是:

  • 在仅包含控件(不是 exe 或其他内容)的 dll 文件中。
  • generic.Xaml 和另一个(现在:Generic.Core.xaml)位于同一个程序集、同一个文件夹中。

我阅读了有关包 URL 的 MSDN 部分,但对于看起来很简单的东西来说,这听起来真的很复杂。

;) 请帮忙。

【问题讨论】:

    标签: wpf themes generic.xaml


    【解决方案1】:

    找到了:

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

    这行得通。
    需要为程序集添加前缀(将Tradex.Presentation 替换为程序集名称)并以component 项开头。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-07
      • 2015-05-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多