Exemplo n.º 1
0
        private void DisplayStory(string storyId)
        {
            ViewModelBase.CurrentStoryId = storyId;
            if (Config.UIStatus == AppUIStatus.All || Config.UIStatus == AppUIStatus.ListAndContent)
            {
                MainContentFrame.Navigate(typeof(MainContentPage), storyId);
                CommentFrame.Navigate(typeof(CommentPage), storyId);
            }
            else
            {
                Frame rootFrame = App.GetWindowFrame();
                if (rootFrame == null)
                {
                    return;
                }

                NavigationManager.Instance.Navigate(rootFrame, typeof(MainContentPage), storyId);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Return to the previous frame
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Back_Click(object sender, RoutedEventArgs e)
 {
     if (MainContentFrame.CanGoBack)
     {
         if (MainContentFrame.BackStack.Count == 0)
         {
             SelectHamburgerOption("BrowseItem", true);
         }
         else
         {
             PageStackEntry page = MainContentFrame.BackStack.ElementAt(MainContentFrame.BackStack.Count - 1);
             HamburgerOptions.SelectionChanged -= HamburgerOptions_SelectionChanged;
             if (page.SourcePageType == typeof(Browse))
             {
                 SelectHamburgerOption("BrowseItem", false);
                 Title.Text = "Browse";
             }
             else if (page.SourcePageType == typeof(YourMusic))
             {
                 SelectHamburgerOption("YourMusicItem", false);
                 Title.Text = "Your Music";
             }
             else if (page.SourcePageType == typeof(Profile))
             {
                 SelectHamburgerOption("ProfileItem", false);
                 Title.Text = "Profile";
             }
             else if (page.SourcePageType == typeof(Search))
             {
                 SelectHamburgerOption("SearchItem", false);
                 Title.Text = "Search";
             }
             else if (page.SourcePageType == typeof(Settings))
             {
                 SelectHamburgerOption("SettingsItem", false);
                 Title.Text = "Settings";
             }
             HamburgerOptions.SelectionChanged += HamburgerOptions_SelectionChanged;
         }
         MainContentFrame.GoBack();
     }
 }
Exemplo n.º 3
0
        private void OnUtilityListBoxChanged(object sender, SelectionChangedEventArgs e)
        {
            if (TripPlannerListItem.IsSelected)
            {
                MainContentFrame.Navigate(typeof(TripPlannerWindow));
            }

            if (DeparturesListItem.IsSelected)
            {
                MainContentFrame.Navigate(typeof(DeparturesWindow));
            }

            if (SettingsListItem.IsSelected)
            {
                MainContentFrame.Navigate(typeof(SettingsWindow), new Action(() =>
                {
                    // Translate sidebar whenever the language setting is modified
                    DeparturesText.Text  = _translator["Departures.Text"];
                    TripPlannerText.Text = _translator["TripPlanner.Text"];
                    SettingsText.Text    = _translator["Settings.Text"];
                }));
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// When key is pressed, check for special key
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Page_KeyUp(object sender, KeyRoutedEventArgs e)
 {
     if (AnnouncementsContainer.Visibility != Visibility.Visible)
     {
         if (e.Key == VirtualKey.GamepadView)
         {
             MainSplitView.IsPaneOpen = !MainSplitView.IsPaneOpen;
         }
         else if (e.Key == VirtualKey.GamepadY)
         {
             SelectHamburgerOption("SearchItem", true);
         }
         else if (e.Key == VirtualKey.GamepadX)
         {
             if (App.playbackService.showing)
             {
                 PlaybackMenu.FocusPlayPause();
             }
         }
         else if (e.Key == VirtualKey.GamepadRightThumbstickButton)
         {
             if (App.playbackService.showing)
             {
                 if (App.playbackService.Player.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
                 {
                     App.playbackService.Player.Pause();
                 }
                 else
                 {
                     App.playbackService.Player.Play();
                 }
             }
         }
         else if (e.Key == VirtualKey.GamepadRightThumbstickRight)
         {
             if (App.playbackService.showing)
             {
                 App.playbackService.NextTrack();
             }
         }
         else if (e.Key == VirtualKey.GamepadRightThumbstickLeft)
         {
             if (App.playbackService.showing)
             {
                 App.playbackService.PreviousTrack();
             }
         }
         else if (e.Key == VirtualKey.Down && e.OriginalSource is Button && ((Button)e.OriginalSource).Name == "Back")
         {
             MainContentFrame.Focus(FocusState.Programmatic);
         }
         else if (e.Key == VirtualKey.Escape && e.OriginalSource is Slider && ((Slider)e.OriginalSource).Name == "VolumeSlider")
         {
             PlaybackMenu.VolumeSlider_LostFocus(null, null);
             PlaybackMenu.FocusOnVolume();
         }
         else if (e.Key == VirtualKey.Escape)
         {
             Back_Click(null, null);
         }
     }
 }
 private void New_Recipe_Onboarding(object sender, RoutedEventArgs e)
 {
     MainContentFrame.Navigate(typeof(RecipeOnboarding));
     SplitView.splitviewPage.MainNav.IsPaneOpen = false;
 }
Exemplo n.º 6
0
 private void MainContentFrame_OnLoaded(object sender, RoutedEventArgs e)
 {
     MainContentFrame.Navigate(SearchPage);
 }
Exemplo n.º 7
0
 private void MainSwitcherSearchButton_OnChecked(object sender, RoutedEventArgs e)
 {
     MainContentFrame?.Navigate(SearchPage);
 }
Exemplo n.º 8
0
 private void Setting_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
 {
     ViewModel.SelectedApp = null;
     MainContentFrame.Navigate(typeof(TestPage));
 }
Exemplo n.º 9
0
 // ハンバーガーメニューで[ページ【3】]が新たに選択された
 private void RadioButton3_Checked(object sender, RoutedEventArgs e)
 {
     MainContentFrame.Navigate(typeof(Setting.SettingHubPage));
     Splitter.IsPaneOpen = false;
 }
Exemplo n.º 10
0
 // ハンバーガーメニューで[ページ【1】]が新たに選択された
 private void RadioButton1_Checked(object sender, RoutedEventArgs e)
 {
     MainContentFrame.Navigate(typeof(Browser.MainBrowser));
     Splitter.IsPaneOpen = false;
 }
Exemplo n.º 11
0
 private void MainSwitcherQueueButton_OnChecked(object sender, RoutedEventArgs e)
 {
     MainContentFrame?.Navigate(new QueuePage());
 }
Exemplo n.º 12
0
 /// <summary>
 /// Laduje strone AddProductPage
 /// </summary>
 private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
 {
     MainContentFrame.Navigate(new AddProductPage());
 }
Exemplo n.º 13
0
 /// <summary>
 /// Laduje strone HomePage
 /// </summary>
 private void HomeListButton_OnClick(object sender, RoutedEventArgs e)
 {
     MainContentFrame.Navigate(new HomePage());
 }
Exemplo n.º 14
0
 /// <summary>
 /// Laduje strone ProductsPage
 /// </summary>
 private void ProductsButton_OnClick(object sender, RoutedEventArgs e)
 {
     MainContentFrame.Navigate(new ProductsPage());
 }