Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close() with MessageBoxResult isn't implemented #1046

Open
Difegue opened this issue Apr 10, 2024 · 0 comments
Open

Close() with MessageBoxResult isn't implemented #1046

Difegue opened this issue Apr 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Difegue
Copy link

Difegue commented Apr 10, 2024

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

[Obsolete($"Use {nameof(Close)} with MessageBoxResult instead")]

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

@Difegue Difegue added the bug Something isn't working label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant