-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add back support for using MainPage instead of CreateWindow #1262
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
Conversation
# Conflicts: # src/Compatibility/Core/src/AppHostBuilderExtensions.Controls.cs # src/Core/src/Platform/Windows/MauiWinUIApplication.cs
Debug.WriteLine($"The .NET Purple color is {Resources["DotNetPurple"]}"); | ||
Debug.WriteLine($"The injected text service had a message: '{textService.GetText()}'"); | ||
|
||
MainPage = Services.GetRequiredService<Page>(); |
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.
We can use MainPage for single page apps.
(TestWindow)(this as IApplication).CreateWindow(null); | ||
|
||
protected override IWindow CreateWindow(IActivationState activationState) | ||
protected override Window CreateWindow(IActivationState activationState) |
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.
The Windows
property is now a list of Control's Window as that is probably what we want at this level.
// Events called by the Application | ||
public delegate void OnApplicationCreating(Application application); | ||
public delegate void OnApplicationCreate(Application application); | ||
public delegate void OnApplicationLowMemory(Application application); | ||
public delegate void OnApplicationTrimMemory(Application application, TrimMemory level); | ||
public delegate void OnApplicationConfigurationChanged(Application application, Configuration newConfig); |
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.
Add some new application events.
Description of Change
This PR adds the ability for the use of the MainPage property on Application to specify the page, rather than creating a new window which as of yet has no special features.