Modern UI how to go to another page from another link

后端 未结 2 1628
不知归路
不知归路 2021-01-07 03:16

I am currently using Modern UI from CodePlex. It is great and easy to use but there are some classes and events that I am not familiar with. Example: I have two GroupLinks n

2条回答
  •  天涯浪人
    2021-01-07 03:59

    You are mixing "page" navigation with "tab" navigation inside the ModernTab control.

    If you call NavigationCommands.GoToPage.Execute inside a ModernTab control you are changing the current "tab", not the current "page".

    To change the top level page you can use:

    IInputElement target = NavigationHelper.FindFrame("_top", this);
    NavigationCommands.GoToPage.Execute("/Pages/BasicPage1.xaml", target);
    

    If the new page is another ModernTab and you want to select a different tab then the default one, then you have to put in place some extra code. In example you could pass parameters to the new page. Se this SO answer.

提交回复
热议问题