Looking up in MahApps.Metro
I found that ContextMenu's Style
has the Key MetroContextMenu
.
So you just can create your normal ContextMenu in CodeBehind. The you could add the following Style
to your App.xaml
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.ContextMenu.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<!-- Accent and AppTheme setting -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Green.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
<!-- Apply MetroStyle for ContextMenu to ContextMenus in Application scope -->
<Style TargetType="ContextMenu" BasedOn="{StaticResource MetroContextMenu}" />
</Application.Resources>
It is only the you have to apply to your ContextMenu
. There is no special ContextMenu
control provided by MahApps (it is only the Style
!).