WPF - 在 xaml 中使用 RibbonControlsLibrary 的 MergedDictionary [英] WPF - MergedDictionary using RibbonControlsLibrary in xaml
本文介绍了WPF - 在 xaml 中使用 RibbonControlsLibrary 的 MergedDictionary的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在后面的代码中,这是有效的:
In code behind, this works:
this.Resources.MergedDictionaries.Add(Microsoft.Windows.Controls.Ribbon.PopularApplicationSkins.Office2007Black);
如何在 xaml 中执行此操作?
How do I do this in xaml?
推荐答案
请尝试以下操作:-
<Window x:Class="WPFRibbon.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
Title="Window1" Height="300" Width="400">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/RibbonControlsLibrary;component/Themes/Office2007Black.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
这篇关于WPF - 在 xaml 中使用 RibbonControlsLibrary 的 MergedDictionary的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文