lepoco / wpfui

WPF UI provides the Fluent experience in your known and loved WPF framework. Intuitive design, themes, navigation and new immersive controls. All natively and effortlessly.
https://wpfui.lepo.co
MIT License
7.04k stars 667 forks source link

Close() with MessageBoxResult isn't implemented #1046

Open Difegue opened 2 months ago

Difegue commented 2 months ago

Describe the bug

Overriding OnButtonClick() in the WPFUI MessageBox doesn't allow me to just call Close(), throwing an InvalidOperationException asking me to use the version with MessageBoxResult.

Which would be fine... if that method existed? MessageBox doesn't seem to have a Close(MessageBoxResult) method implemented, instead relying on the WPF Close() internally.

To Reproduce

Try subclassing MessageBox and overriding OnButtonClick()

Expected behavior

Being able to Close() the popup myself without having to downcast to Window

Screenshots

No response

OS version

Irrelevant

.NET version

Irrelevant

WPF-UI NuGet version

3.0.3

Additional context

https://github.com/lepoco/wpfui/blob/bf3c4a6be4ed05a3ab3f34fd0e88b2fe191714bb/src/Wpf.Ui/Controls/MessageBox/MessageBox.cs#L302

https://github.com/lepoco/wpfui/blob/development/src/Wpf.Ui/Controls/MessageBox/MessageBox.cs#L302