-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
XPlat Window Lifecycle #1720
Comments
. |
Why no Closed? For example can I use this Window Lifecycle to hook into starting some background tasks and then use this for ending those background tasks gracefully? Currently for WinUI i am using (But i want to also have this app run on a Mac)
|
@pjmagee I don't think iOS or Android support running code before an app is closed. Android can decide to kill an app any time it is in the background. Though it could be worth adding for the sake of completeness. Usually, you will be doing the same action in OnPause and OnClose. Actually, Android recommends you treat OnPause as if it was OnClose and assume that the app isn't coming back to the foreground. |
So using Maui Blazor purely for desktop on Windows / Mac. I should be able to use OnPause and assume the Window was just closed? - Application terminated, Not Minimized. |
I'm not super familiar with the specifics on this question, but in .NET MAUI (including Blazor Desktop, such as .NET MAUI + Blazor), if you know which platform you're running on, you can use any platform-specific API that you want. So if on Windows (in WinUI) there's some API you want to use (including any Win32 native API), you can use that for whatever you want. But I don't know specifically about pause/resume behaviors and what each OS offers. |
I've updated the spec here with a couple more events and some additional justification for my decisions. Let me know your thoughts |
LifeCycle
Window
Destroying
overClosing
because it's the opposite ofCreated
and I feel thatClosing
represents an explicit action where the user has expressed that they no longer want anything to do with a window.Closing
will makes sense once we have multi-window.Platform Mappings
The text was updated successfully, but these errors were encountered: