benruehl / adonis-ui

Lightweight UI toolkit for WPF applications offering classic but enhanced windows visuals
https://benruehl.github.io/adonis-ui/
MIT License
1.71k stars 143 forks source link

Add Styled MessageBox #35

Closed micah686 closed 4 years ago

micah686 commented 4 years ago

I would like there to be a messagebox that fits with the style of the white/dark theme. It's currently jarring when you have to use the default messagebox against a dark themed application.

A MessageBox that would inherit the light/dark styles currently available

I've considered making a custom messagebox using a standard window

benruehl commented 4 years ago

Thank you for the idea!

The MessageBox itself cannot be styled unfortunately because it is a native control [1]. In order to style it, it has to be recreated as a custom window like you mentioned. I think this would be an option though.

Bert-Proesmans commented 4 years ago

Stylet, which intentionally works with View-models only, built its own message box. It basically reuses components from the Windows libs. This might be useful as quickstart tutorial. View: https://github.com/canton7/Stylet/blob/4fa7b9ca1a45e8d7455b101d7fed5cdc2990d069/Stylet/MessageBoxView.xaml Model: https://github.com/canton7/Stylet/blob/4fa7b9ca1a45e8d7455b101d7fed5cdc2990d069/Stylet/MessageBoxViewModel.cs