如何在wpf应用程序中包含和使用Themes

时间:2017-12-12 04:26:01

标签: wpf xaml themes

我必须在我的wpf应用程序中包含主题,并将它们用于窗口(.xaml)和控件的外观和感觉。

我试图包含主题文件,如下面的代码,但它是抛出错误。

 <Application.Resources>
    <ResourceDictionary Source="\Themes\BureauBlack.xaml"/>

如何指定将构建操作指定为资源

的主题文件的源路径

1 个答案:

答案 0 :(得分:0)

尝试使用MergedDictionaries:

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="Generic_UI/BlueColors.xaml"/>
            <ResourceDictionary Source="Generic_UI/KStyles.xaml"/>
            <ResourceDictionary Source="Generic_UI/KButtons.xaml"/>
            <ResourceDictionary Source="Generic_UI/KWindow.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>
相关问题