Skip to content

Migrating App.xaml.cs OnX() to Prism MAUI? #3036

Discussion options

You must be logged in to vote

To be honest OnAppStart should probably be renamed CreateDefaultWindow. Something to consider when migrating from Xamarin.Forms to .NET MAUI is that while Application.MainPage does still technically exist it is really there for backwards compatibility. Ultimately they should have removed it from the MAUI API.

As for the Application OnStart, OnSleep, and OnResume there are a couple of options you would have. Generally speaking I would suggest using standard Dependency Injection for any services you may need to access in those methods or any others in the Application. However if you needed to resolve the INavigationService I would generally suggest lazy loading it through the Handler.MauiCo…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dansiegel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants