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

Support simulating a Window close by user, which sets IsProgrammatic to false #17846

Open
Measurity opened this issue Dec 30, 2024 · 0 comments

Comments

@Measurity
Copy link

Measurity commented Dec 30, 2024

Is your feature request related to a problem? Please describe.

I want to provide custom controls with buttons that close a window. However, this is code outside of Avalonia, so the window closing event will have IsProgrammatic == true. Any logic relying on this flag will then be wrong.

Describe the solution you'd like

Add parameter to Window.Close method to specify IsProgrammatic value (default true?).

Describe alternatives you've considered

As a workaround I wrapped the Window.Close in extension methods and called those instead, wherever needed.

Additional context

Original feature request for IsProgrammatic: #9524

@Measurity Measurity changed the title Add parameter to Window.Close which sets IsProgrammatic to false, simulating a close by user Support simulating a Window close by user, which sets IsProgrammatic to false Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant