Beispiel #1
0
        private void XAML_NavigationView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
        {
            if (args.IsSettingsInvoked)
            {
                XAML_ContentFrame.Navigate(typeof(SettingsPage), null);
            }
            else
            {
                var navItem  = (DSANavItem)((NavigationViewItem)sender.SelectedItem).Tag;
                var lastItem = navHistory.LastOrDefault();

                if (navItem.NavType == typeof(SavePage))
                {
                    Game.CharakterSave(out DSAError error);
                    SaveDialog.ShowDialog(error);
                    XAML_NavigationView.SelectedItem = startItem;

                    if (lastItem.NavType != typeof(HeroLetterPage))
                    {
                        XAML_ContentFrame.Navigate(typeof(HeroLetterPage));
                    }
                }
                else if (lastItem.NavType != navItem.NavType || lastItem.Parameter != navItem.Parameter)
                {
                    XAML_ContentFrame.Navigate(navItem.NavType, navItem.Parameter);
                }
            }
        }
Beispiel #2
0
        private void Game_NavRequested(object sender, util.EventNavRequest e)
        {
            switch (e.Side)
            {
            case NavEnum.StartPage:
                XAML_ContentFrame.Navigate(typeof(HeroLetterPage), e.Parameter);
                break;

            case NavEnum.CreateTraitPage:
                XAML_ContentFrame.Navigate(typeof(CreateTrait), e.Parameter);
                break;

            case NavEnum.CreateSpellPage:
                XAML_ContentFrame.Navigate(typeof(CreateSpell), e.Parameter);
                break;

            default:
                throw new System.NotImplementedException();
            }
        }