Skip to content

Child window sample forces parent window navigation #2062

@AndrewKeepCoding

Description

@AndrewKeepCoding

Which version of the app?

WinUI 3 Gallery

Description

Parent window navigates back to Home when creating a child window.

  1. Go to the Multiple windows sample page.
  2. Click the Create new Window button.
  3. Both parent and child window navigates to Home.

Screenshots

No response

Windows version

No response

Additional context

We shouldn't use MainWindow for the child window sample anymore.

protected override void OnNavigatedTo(NavigationEventArgs e)
{
    ((NavigationViewItem)App.MainWindow.NavigationView.MenuItems.First()).IsSelected = true;
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions