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

Window.Parent is null with Classic Navigation #8635

Closed
dansiegel opened this issue Jul 10, 2022 · 0 comments
Closed

Window.Parent is null with Classic Navigation #8635

dansiegel opened this issue Jul 10, 2022 · 0 comments
Assignees
Labels
area-navigation NavigationPage fixed-in-6.0.486 Look for this fix in 6.0.486 SR4! fixed-in-7.0.0-rc.1.6683 partner Issue or Request from a partner team platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@dansiegel
Copy link
Contributor

Description

When not using Shell & recursing up Element.Parent this currently will stop at the Window as the Window.Parent is null rather than being set to the Application. This prevent any custom code at runtime to recurse the UI tree and access the Application. This appears to be a problem when NOT using Shell.

Shell Stack Classic Stack
image image

SAMPLE
MauiApp2.zip

Steps to Reproduce

  1. Create MAUI app
  2. Do not use Shell
  3. Once everything has been parented... such as OnAppearing recurse the Parent until null... the Window.Parent will be null

Setting the Main Page to a Shell Works correctly

public partial class App : Application
{
    public App()
    {
        InitializeComponent();
        MainPage = new AppShell();
    }
}

Setting the Main Page to a Page does not...

public partial class App : Application
{
    public App()
    {
        InitializeComponent();
        MainPage = new MainPage();
    }
}

It makes no difference if setting the MainPage property or overriding CreateWindow

Version with bug

6.0.400 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, Windows, I was not able test on other platforms

Affected platform versions

yes

Did you find any workaround?

No response

Relevant log output

No response

@dansiegel dansiegel added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Jul 10, 2022
@jsuarezruiz jsuarezruiz added area-navigation NavigationPage platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Jul 11, 2022
@jsuarezruiz jsuarezruiz self-assigned this Jul 11, 2022
@jsuarezruiz jsuarezruiz added this to the 6.0-servicing milestone Jul 11, 2022
@samhouts samhouts added the p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint label Jul 12, 2022
@samhouts samhouts added partner Issue or Request from a partner team and removed p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint labels Jul 20, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 27, 2022
@samhouts samhouts added the fixed-in-6.0.486 Look for this fix in 6.0.486 SR4! label Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-navigation NavigationPage fixed-in-6.0.486 Look for this fix in 6.0.486 SR4! fixed-in-7.0.0-rc.1.6683 partner Issue or Request from a partner team platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants