wpf - 拆分Generic.Xaml-加载MergedDictionaries时出现问题

标签 wpf themes generic.xaml

在一个很大的控件库上工作的generic.xaml会使simpy失去控制。我想通过控制对其进行拆分(尽管对于一个仅包含一些简单 namespace 的 namespace 来说,这一次)。

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

然后,在generic.Xaml中添加:

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

还有...出现加载错误。

什么是正确的网址?

这是:
  • 在仅包含控件(而不是exe等)的dll文件中。
  • generic.Xaml和另一个(现在为:Generic.Core.xaml)位于同一程序集中,同一文件夹中。

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

    ;) 请帮忙。

    最佳答案

    找到了:

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

    那个有效。
    需要给程序集加上前缀(用程序集名称替换Tradex.Presentation),并从component项开始。

    关于wpf - 拆分Generic.Xaml-加载MergedDictionaries时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3296834/

    相关文章:

    wpf - 自定义控件边框画笔属性不一致?

    c# - 如何在 WPF 中的文本上创建多个笔划?

    c# - WPF ComboBox : static list of ComboBoxItems, 但数据绑定(bind) SelectedItem?

    css - Wordpress 插件 - CSS 未加载

    reactjs - NX Monorepo 使用一个 UI 组件库,具有多个具有不同主题的应用程序

    php - 如何使用 Laravel 制作自定义主题以及存储主题数据的位置?

    c# - 通用应用程序 TextBlockButtonStyle

    MVVM 环境中的 WPF Datagrid RowEditEnding

    c# - 每个显示器 DPI 感知的 WPF 应用程序与 RibbonWindow

    wpf - 不应用generic.xaml中的样式