/ / WPF - MergedDictionary utilisant RibbonControlsLibrary dans xaml - wpf, xaml, ribboncontrolslibrary

WPF - MergedDictionary utilisant RibbonControlsLibrary dans xaml - wpf, xaml, ribboncontrolslibrary

Dans le code derrière, cela fonctionne:

 this.Resources.MergedDictionaries.Add(Microsoft.Windows.Controls.Ribbon.PopularApplicationSkins.Office2007Black);

Comment est-ce que je fais ceci dans xaml?

Réponses:

2 pour la réponse № 1

Essayez ce qui suit: -

<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>