5

I would like to change the style of a message dialog. I used this: How to change MahApps.Metro dialog content template width?

I want different styles for some dialogues. How can I change the style of a single dialog? I tried to do it with the CustomResourceDictionary property. But this has no effect.

var Style = (Style) Application.Current.Resources["NewCustomDialogStyle"];
var mySettings = new MetroDialogSettings()
    {
        CustomResourceDictionary = Style.Resources
    };

When I override the MessageDialog style everything is fine

<Style TargetType="{x:Type Dialog:MessageDialog}" BasedOn="{StaticResource NewCustomDialogStyle}" />
Community
  • 1
  • 1
Benedikt
  • 109
  • 2
  • 4

1 Answers1

0

You need create new style based on Mahapps style. You can find it here: https://github.com/MahApps/MahApps.Metro/blob/336f7dfc4bda2d0eba8aa270737ca3c11d45128c/src/MahApps.Metro/MahApps.Metro/Themes/Dialogs/MessageDialog.xaml

And then use it only for whatever you want dialog

Denis Kosov
  • 697
  • 6
  • 21