Search code examples
c#wpftemplatesmessagebox

"Overwrite" MessageBox Template


I have already a big application, with lot of MessageBox inside.

I would like to make a template for all MessageBoxes (Background, Border etc...). Is it possible through the App.xaml to do that easily, or do I necessarly think to make my own custom MessageBox, and so replace all MessageBoxes of my solution? I tried in App.xaml but I cannot see a possibility to set TargetType="MessageBox".


Solution

  • I think this is not possible. It's a native Windows control. But you can create your own very easy. You can use a customized Window and then show it modal by calling Window.ShowDialog().