Programmatically navigation?

Feb 19, 2016 at 6:29 AM
Hello. Simple question. Can I programmatically navigate to other pages?
Thansk!
Feb 24, 2016 at 11:09 AM
Edited Feb 25, 2016 at 1:29 AM
Hi, I don't know correctly answser...

However, You refer to fallowing code.
  • xaml
     <mui:ModernWindow.TitleLinks>
        <mui:Link DisplayName="{StaticResource About}"
                  Source="Presentation/About.xaml" />
        <mui:Link DisplayName="{StaticResource Help}"
                  Source="Presentation/Help.xaml"/>
    </mui:ModernWindow.TitleLinks>

    <mui:ModernWindow.MenuLinkGroups>
        <mui:LinkGroup DisplayName="{StaticResource Home}">
            <mui:LinkGroup.Links>
                <mui:Link Source="Presentation/Home.xaml"/>
            </mui:LinkGroup.Links>
        </mui:LinkGroup>
        <mui:LinkGroup DisplayName="{StaticResource Board}" >
            <mui:LinkGroup.Links>
                <mui:Link Source="Presentation/Board.xaml"/>
            </mui:LinkGroup.Links>
        </mui:LinkGroup>
        <mui:LinkGroup DisplayName="{StaticResource Setting}">
            <mui:LinkGroup.Links>
                <mui:Link Source="Presentation/Settings/Settings.xaml"/>
            </mui:LinkGroup.Links>
        </mui:LinkGroup>
    </mui:ModernWindow.MenuLinkGroups>
  • nevigation code
        public async void ShowDrawPen() {
            if (Board.Instance == null) {
                try {
                                          System.Threading.Tasks.Task.Run(() =>
                                  {
                                    this.Dispatcher.Invoke(() =>
                                {
                                                     this.ContentSource = new Uri("Presentation/Board.xaml", UriKind.Relative); //navigate link
                                    });
                                          });
                    
                    //await this.ContentLoader.LoadContentAsync(new Uri("Presentation/Board.xaml", UriKind.Relative), System.Threading.CancellationToken.None); //link class load, no navigate link. (not use)
                }
                catch (Exception error) {
                    ModernDialog.ShowMessage(error.Message, FirstFloor.ModernUI.Resources.NavigationFailed, MessageBoxButton.OK);
                }
            }

            /**/

            if (Board.Instance != null) {
                Board.Instance.ShowDrawPen();
            }
        }
I hope help you. on this code.

good luck.