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

[♻️ Housekepping] Until .NET 9 we should avoid Application.MainPage #2054

Open
pictos opened this issue Jul 23, 2024 · 0 comments
Open
Labels
area/core Issue/Discussion/PR that has to do with the core of the toolkit

Comments

@pictos
Copy link
Member

pictos commented Jul 23, 2024

The .NET MAUI team is deprecating the usage of Application.MainPage because it, normally, isn't what devs/we expect to be. In a MultiWindow scenario it can return the wrong Page.

One way to workaround this is to change Application.Current.MainPage to Application.Current.Windows[0].Page.

At least for me, isn't 100% clear what Windows[0] means:

  • it's the first window at collection
  • it's the topmost window
  • it's the focused window

For join the discussion at .NET MAUI repo, please go here.

Maybe, today we already have a bug for multi-window apps, but since no user has reported any issue we don't need to rush on this.

@vhugogarcia vhugogarcia added the area/core Issue/Discussion/PR that has to do with the core of the toolkit label Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core Issue/Discussion/PR that has to do with the core of the toolkit
Projects
None yet
Development

No branches or pull requests

2 participants