-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add ApplicationHandler #2653
Add ApplicationHandler #2653
Conversation
Remove IPlatformServices.QuitApplication()
{ | ||
public static void MapRequestTerminate(ApplicationHandler handler, IApplication application, object? args) | ||
{ | ||
handler.NativeView.Exit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Conflicts: # src/Core/src/Platform/MauiContext.Android.cs
src/Core/src/Handlers/Application/ApplicationHandler.Android.cs
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
src/Core/src/Handlers/Application/ApplicationHandler.Android.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
I'd recommended making IMauiApplicationContext, IMauiWindowContext, and the related concrete classes internal. I could see these eventually becoming apart of our better scoping solution. For now we could expose Application/Window to users via extension methods?
-
And then we can create a tracking issue for the possible exit options on Android?
Need to re-verify iOS, but I think the code is ready again. And of course some rando errors. |
Android (and others) quitting stuff: #2814 |
Description of Change
This PR adds an
ApplicationHandler
so that an app can invoke a "quit" action. Previously this was onIPlatformServices
, but now we got handlers - and not only that, it is easily overridable by setting the method in the mappers.#1965
Additions made
ApplicationHandler
IPlatformServices.QuitApplication()
ScopedMauiContext
andIScopedMauiContext
IMauiContext
and puts it inside a "proxy"IServiceProvider
MakeScoped
with various overloads to wrap a context and add additional specific values (window, animation manager, fragment manager)It also removes the various
Forms.Init()
calls that do not take a maui context. This is no longer needed since we got the compat extensions using the lifecycle events.PR Checklist
Does this PR touch anything that might affect accessibility?
If any of the above checkboxes apply to your PR, then the PR will need to provide testing to demonstrate that accessibility still works.