public MainPage() { InitializeComponent(); if (current == null) { current = this; ScenarioFrame.Navigate(typeof(ZViewHomepage)); searchCombobox.DataContext = ZNavigation.NavigationCombobox; searchCombobox.SelectedIndex = 0; scenarioListBox.DataContext = ZNavigation.NavigationItems.Values.ToList(); scenarioListBox.SelectedIndex = 0; } }
/// <summary> /// Called whenever the user changes selection in the scenarios list. This method will navigate to the respective /// sample scenario page. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DeviceList_SelectionChanged(object sender, SelectionChangedEventArgs e) { // Clear the status block when navigating scenarios. NotifyUser(String.Empty, NotifyType.StatusMessage); ListBox devListBox = sender as ListBox; Scenario s = devListBox.SelectedItem as Scenario; if (s != null) { ScenarioFrame.Navigate(s.ClassType); if (Window.Current.Bounds.Width < 640) { Splitter.IsPaneOpen = false; } } }
private void ScenarioControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { // Clear the status block when navigating scenarios. NotifyUser(String.Empty, NotifyType.StatusMessage); var scenarioListBox = sender as ListBox; if (!(scenarioListBox.SelectedItem is Scenario s)) { return; } ScenarioFrame.Navigate(s.ClassType); if (Window.Current.Bounds.Width < 640) { Splitter.IsPaneOpen = false; } }
private void ScenarioControl_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { NotifyUser(String.Empty, NotifyType.StatusMessage); ListBox scenarioListBox = sender as ListBox; Obserview s = scenarioListBox.SelectedItem as Obserview; if (s != null) { //跳转到对应的页面 ScenarioFrame.Navigate(s.ClassType); if (Window.Current.Bounds.Width < 640) { SplitViewer.IsPaneOpen = false; } } }
/// <summary> /// Called whenever the user changes selection in the scenarios list. This method will navigate to the respective /// sample scenario page. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ScenarioControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { // Clear the status block when navigating scenarios. NotifyUser(String.Empty, NotifyType.StatusMessage); ListView scenarioListBox = sender as ListView; Scenario s = scenarioListBox.SelectedItem as Scenario; if (s != null) { ScenarioFrame.Navigate(s.ClassType); if (Window.Current.Bounds.Width < 640) { Splitter.IsPaneOpen = false; StatusBorder.Visibility = Visibility.Collapsed; } } }
private void NavigateToScenario(Type scenario, object param = null) { ScenarioFrame.Navigate(scenario, param); if (Window.Current.Bounds.Width < 640) { Splitter.IsPaneOpen = false; StatusBorder.Visibility = Visibility.Collapsed; } if (scenario == typeof(CardReader)) { StatusBlockScroller.MaxHeight = Math.Max(300, Window.Current.Bounds.Height - 200); } else { StatusBlockScroller.MaxHeight = 300; } }
private void ScenarioControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { // Clear the status block when navigating scenarios. try { ListBox scenarioListBox = sender as ListBox; FTEScenario s = scenarioListBox.SelectedItem as FTEScenario; if (s != null) { ScenarioFrame.Navigate(s.ClassType); if (Window.Current.Bounds.Width < 640) { Splitter.IsPaneOpen = false; } } } catch { } }
/// <summary> /// Called whenever the user changes selection in the scenarios list. This method will navigate to the respective /// sample scenario page. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ScenarioControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { // Clear the status block when navigating scenarios. NotifyUser(String.Empty, NotifyType.StatusMessage); ListBox scenarioListBox = sender as ListBox; Scenario s = scenarioListBox.SelectedItem as Scenario; if (s != null) { ScenarioFrame.Navigate(s.ClassType); if (Window.Current.Bounds.Width < 640) { Splitter.IsPaneOpen = false; } } // Set keyboard focus on the menu button MenuButton.Focus(FocusState.Keyboard); }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); //Populate the scenario list from the Configuration File ScenarioControl.ItemsSource = scenarios; if (Window.Current.Bounds.Width < 640) { ScenarioControl.SelectedIndex = -1; } else { ScenarioControl.SelectedIndex = 0; } if (!Globals.appSettings.Containers.ContainsKey("Storage")) { ScenarioControl.SelectedIndex = 1; ScenarioFrame.Navigate(typeof(StorageSettings)); } }
private void ScenarioControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { //NotifyUser(String.Empty, NotifyType.StatusMessage); ListBox scenarioListBox = sender as ListBox; Scenario s = scenarioListBox.SelectedItem as Scenario; PassData passData = new PassData { BeginUri = s.Bi }; if (s != null) { ScenarioFrame.Navigate(s.ClassType, passData); if (Window.Current.Bounds.Width < 640) { Splitter.IsPaneOpen = false; } } }
private void ScenarioControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { //Clear the status Block when navigating scenarios NotifyUser(String.Empty, NotifyType.StatusMessage); ListBox scenarioListBox = sender as ListBox; Scenario s = scenarioListBox.SelectedItem as Scenario; if (s != null) { if (s.ClassType == typeof(MainPage)) { Frame.Navigate(typeof(MainPage)); } else { ScenarioFrame.Navigate(s.ClassType); if (Window.Current.Bounds.Width < 640) { Splitter.IsPaneOpen = false; } } } }
private void ScenarioControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { //Clear the status Block when navigating scenarios NotifyUser(String.Empty, NotifyType.StatusMessage); ListBox scenarioListBox = sender as ListBox; Scenario s = scenarioListBox.SelectedItem as Scenario; if (s != null) { if (s.ClassType == typeof(MainPage)) { int c = 0; foreach (var p in Globals.projects) { if (p.projectName == FEATURE_NAME) { Globals.projects[c].lastModified = DateTime.Now; Globals.SortProjectList(); } c++; } //Save List To File Globals.SaveProjecList(); Frame.Navigate(typeof(MainPage)); } else { ScenarioFrame.Navigate(s.ClassType); if (Window.Current.Bounds.Width < 640) { Splitter.IsPaneOpen = false; } } } }
/// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. The Parameter /// property is typically used to configure the page.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { String launchArgs = e.Parameter as String; if (launchArgs != null && launchArgs.Contains("Windows.Networking.Proximity.PeerFinder:StreamSocket")) { _isLaunchedByTap = true; _appRole = PeerRole.Peer; if (!ScenarioFrame.Navigate(typeof(PeerFinderScenario))) { throw new Exception("Failed to navigate to PeerFinderScenario!"); } } SuspensionManager.RegisterFrame(ScenarioFrame, "scenarioFrame"); if (ScenarioFrame.Content == null) { // When the navigation stack isn't restored navigate to the ScenarioList if (!ScenarioFrame.Navigate(typeof(ScenarioList))) { throw new Exception("Failed to create scenario list"); } } }
/// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. The Parameter /// property is typically used to configure the page.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { SuspensionManager.RegisterFrame(ScenarioFrame, "scenarioFrame"); if (ScenarioFrame.Content == null) { // When the navigation stack isn't restored navigate to the ScenarioList if (!ScenarioFrame.Navigate(typeof(ScenarioList))) { throw new Exception("Failed to create scenario list"); } // If there is a parameter then continue the navigation to the appropriate page. if (!String.IsNullOrWhiteSpace(e.Parameter.ToString())) { this.LaunchParam = e.Parameter.ToString(); int index = 0; this.GetScenarioIdForLaunch(this.LaunchParam, ref index); if (!ScenarioFrame.Navigate(this.scenarios[index].ClassType)) { throw new Exception("Failed to create scenario list"); } } } }
private void Patients_Click(object sender, RoutedEventArgs e) { ScenarioFrame.Navigate(scenarios[2].ClassType); }
private void Grid_Tapped(object sender, TappedRoutedEventArgs e) { ScenarioFrame.Navigate(typeof(AudioMainPage)); }
private void setting_Click(object sender, RoutedEventArgs e) { ScenarioFrame.Navigate(typeof(SettingPage)); }
/// <summary> /// 在此页将要在 Frame 中显示时进行调用。 /// </summary> /// <param name="e">描述如何访问此页的事件数据。 /// 此参数通常用于配置页。</param> protected override void OnNavigatedTo(NavigationEventArgs e) { ScenarioFrame.Navigate(typeof(MapPage)); }
public void NavigateToFilePage() { ScenarioFrame.Navigate(this.Scenarios[2].ClassType); }
private void SelfGrid_Tapped(object sender, TappedRoutedEventArgs e) { ScenarioFrame.Navigate(typeof(SelfPage)); }
private void MessageGrid_Tapped(object sender, TappedRoutedEventArgs e) { ScenarioFrame.Navigate(typeof(HomePage)); }
private void InformationButton_Click(object sender, RoutedEventArgs e) { ScenarioFrame.Navigate(typeof(InformationPage)); }
private void FavoriteGrid_Tapped(object sender, RoutedEventArgs e) { ScenarioFrame.Navigate(typeof(FavoritePage), Utils.DataConverter <User> .Convert(currentUser)); }
private void Hardware_Click(object sender, RoutedEventArgs e) { ScenarioFrame.Navigate(typeof(TilePage)); }
public void NavigateToProtocolPage() { ScenarioFrame.Navigate(this.Scenarios[3].ClassType); }
private void FindGrid_Tapped(object sender, RoutedEventArgs e) { ScenarioFrame.Navigate(typeof(SearchPage)); }
private void Procedures_Click(object sender, RoutedEventArgs e) { ScenarioFrame.Navigate(typeof(ModernList)); }
private void SearchGrid_Click(object sender, RoutedEventArgs e) { ScenarioFrame.Navigate(typeof(SearchPage)); }
private void Avatar_Click(object sender, RoutedEventArgs e) { ScenarioFrame.Navigate(scenarios[0].ClassType); }
private void TrendsGrid_Tapped(object sender, RoutedEventArgs e) { ScenarioFrame.Navigate(typeof(TrendsPage)); }