private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (PhotoView.IsSelected) { AppFrame.Navigate(typeof(Domain.Photo.View)); } if (PairView.IsSelected) { AppFrame.Navigate(typeof(Domain.Pair.View)); } if (StudentView.IsSelected) { AppFrame.Navigate(typeof(Domain.Student.View)); } // if (_REPLACEME_View.IsSelected) // { // AppFrame.Navigate(typeof(Domain._REPLACEME_.View)); // } string nameOfSelection = ((ListBoxItem)e.AddedItems[0]).Name; if (nameOfSelection == "Load") { AppFrame.Navigate(typeof(OpeningView)); UserActionPresenter.PresentMessageOkCancel("Are you sure you want to LOAD model data?", "Load", new RelayCommand(AppConfig.Load)); } if (nameOfSelection == "Save") { AppFrame.Navigate(typeof(OpeningView)); UserActionPresenter.PresentMessageOkCancel("Are you sure you want to SAVE model data?", "Save", new RelayCommand(AppConfig.Save)); } }
public Shell() { InitializeComponent(); NavMenuList.ItemsSource = navlist; NavMenuList.SelectedIndex = 0; AppFrame.Navigate(typeof(ColorPalettePage)); }
private void NavigatePage(Type pageType) { if (pageType != null && pageType != AppFrame.CurrentSourcePageType) { AppFrame.Navigate(pageType); } }
private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (MovieView.IsSelected) { TryNavigate(typeof(View), "MovieView"); } if (StudioView.IsSelected) { TryNavigate(typeof(Domain.Studio.View), "StudioView"); } if (Load.IsSelected) { AppFrame.Navigate(typeof(OpeningView)); UIService.PresentMessageSingleActionCancel("Are you sure you want to LOAD model data?", "LOAD", new RelayCommand(PersistencyManager.Load)); } if (Save.IsSelected) { AppFrame.Navigate(typeof(OpeningView)); UIService.PresentMessageSingleActionCancel("Are you sure you want to SAVE model data?", "SAVE", new RelayCommand(PersistencyManager.Save)); } if (Quit.IsSelected) { AppFrame.Navigate(typeof(OpeningView)); UIService.PresentMessageSingleActionCancel("Are you sure you want to QUIT?", "QUIT", new RelayCommand(Application.Current.Exit)); } }
public void NavigateToPage(Type destPage, object parameter = null) { if (this.AppFrame.CurrentSourcePageType != destPage) { AppFrame.Navigate(destPage, parameter, new Windows.UI.Xaml.Media.Animation.SuppressNavigationTransitionInfo()); } }
private void NavigationView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args) { if (args.IsSettingsInvoked) { AppFrame.Navigate(typeof(SettingPage)); } }
public void NavigateToPage(Type destPage) { if (this.AppFrame.CurrentSourcePageType != destPage) { AppFrame.Navigate(destPage, string.Empty, new Windows.UI.Xaml.Media.Animation.SuppressNavigationTransitionInfo()); } }
public override void AddCommands() { NavigationCommands.Add("File", new RelayCommand(() => { AppFrame.Navigate(typeof(Views.App.FileView)); })); NavigationCommands.Add("OpenCarView", new RelayCommand(() => { AppFrame.Navigate(typeof(CarView)); })); NavigationCommands.Add("OpenCustomerView", new RelayCommand(() => { AppFrame.Navigate(typeof(CustomerView)); })); NavigationCommands.Add("OpenEmployeeView", new RelayCommand(() => { AppFrame.Navigate(typeof(EmployeeView)); })); NavigationCommands.Add("OpenSaleView", new RelayCommand(() => { AppFrame.Navigate(typeof(SaleView)); })); }
public override void AddCommands() { NavigationCommands.Add("LeadsPage", new RelayCommand(() => { AppFrame.Navigate(typeof(View.Domain.LeadsPage)); })); NavigationCommands.Add("ActiveLeads", new RelayCommand(() => { AppFrame.Navigate(typeof(View.Domain.LeadsPage)); })); NavigationCommands.Add("PendingLeads", new RelayCommand(() => { AppFrame.Navigate(typeof(View.Domain.LeadsPage)); })); NavigationCommands.Add("ClosedLeads", new RelayCommand(() => { AppFrame.Navigate(typeof(View.Domain.LeadsPage)); })); NavigationCommands.Add("Customers", new RelayCommand(() => { AppFrame.Navigate(typeof(View.Domain.CustomersPage)); })); NavigationCommands.Add("Customer", new RelayCommand(() => { AppFrame.Navigate(typeof(View.Domain.CustomerPage)); })); }
public AppShell() { this.InitializeComponent(); var navmgr = SystemNavigationManager.GetForCurrentView(); navmgr.BackRequested += Navmgr_BackRequested; AppFrame.Navigate(typeof(MainPage)); }
public AppPage() { this.InitializeComponent(); this.Loaded += (s, e) => { masterViewModel.OnLoaded(); }; masterViewModel.PropertyChanged += this.OnPageNavigation; AppFrame.Navigate(typeof(FirstPage)); }
private void NavigationView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args) { var invokedMenuItem = sender.MenuItems.OfType <NavigationViewItem>().Where(item => item.Content.ToString() == args.InvokedItem.ToString()).First(); var pageTypeName = invokedMenuItem.Tag.ToString(); var pageType = Assembly.GetExecutingAssembly().GetType($"{PageNamespace}.{pageTypeName}"); AppFrame.Navigate(pageType); }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.Parameter is Episode) { AppFrame.Navigate(typeof(Player), e.Parameter); } }
public void NavigateTo(string page, object parameter) { if (!_pages.ContainsKey(page)) { throw new ArgumentException($"Unable to find a page registered with the name {page}."); } AppFrame.Navigate(_pages[page], parameter); }
/// <summary> /// Navigate to the Page for the selected <paramref name="listViewItem" />. /// </summary> /// <param name="sender">The sender.</param> /// <param name="listViewItem">The ListViewItem.</param> private void NavMenuList_ItemInvoked(object sender, ListViewItem listViewItem) { var item = (INavigationBarMenuItem)((NavMenuListView)sender).ItemFromContainer(listViewItem); if (item?.DestPage != null && item.DestPage != AppFrame.CurrentSourcePageType) { AppFrame.Navigate(item.DestPage, item.Arguments); } }
private void OnMenuItemClick(object sender, ItemClickEventArgs e) { var item = e.ClickedItem as NavMenuItem; if (item.DestPage != null && item.DestPage != AppFrame.CurrentSourcePageType) { AppFrame.Navigate(item.DestPage, item.Arguments); } }
private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { NavMenuItem item = (NavMenuItem)((ListView)sender).SelectedItem; if (item != null && item.DestPage != null && item.DestPage != AppFrame.CurrentSourcePageType) { AppFrame.Navigate(item.DestPage); } }
private void TryNavigate(System.Type viewType, string viewName) { if (true) // Replace if you want to use login-based access restrictions { AppFrame.Navigate(viewType); } else { // Inform user about insufficient access rights } }
/// <summary> /// Navigates to the specified page and /// supply additional page-specific parameters. /// </summary> /// <param name="page"></param> /// <param name="parameter"></param> public void NavigateTo(string page, object parameter) { lock (pages_) { if (!pages_.ContainsKey(page)) { throw new ArgumentException("Unable to find a page registered with name: " + page); } System.Diagnostics.Debug.Assert(AppFrame != null); AppFrame.Navigate(pages_[page], parameter); } }
/// <summary> /// Navigate to the Page for the selected <paramref name="listViewItem" />. /// </summary> /// <param name="sender">The sender.</param> /// <param name="listViewItem">The ListViewItem.</param> private void NavMenuList_ItemInvoked(object sender, ListViewItem listViewItem) { var item = (INavigationBarMenuItem)((NavMenuListView)sender).ItemFromContainer(listViewItem); // We navigate only if current page is different to target page // or if navigation arguments are available. if ((item.DestPage != null && item.DestPage != AppFrame.CurrentSourcePageType) || _lastSourcePageEventArgs.Item2 != null) { AppFrame.Navigate(item.DestPage, item.Arguments); } }
private void NavMenuList_ItemClick(object sender, ItemClickEventArgs e) { var item = e.ClickedItem as NavMenuItem; if (item != null) { if (item.DestPage != null && item.DestPage != AppFrame.CurrentSourcePageType) { AppFrame.Navigate(item.DestPage); } } }
public void NavigateToStartingPage() { NavMenuItem navMenuItem = null; Type destPage = null; navMenuItem = navlist.First(); destPage = navMenuItem.DestPage; if (navMenuItem != null) { NavMenuList.SelectedItem = navMenuItem; } AppFrame.Navigate(destPage, string.Empty, new Windows.UI.Xaml.Media.Animation.SuppressNavigationTransitionInfo()); }
/// <summary> /// Add valid navigation entries and associated commands. /// </summary> public override void AddCommands() { NavigationCommands.Add("File", new RelayCommand(() => { AppFrame.Navigate(typeof(Views.App.FileView)); })); NavigationCommands.Add("OpenMovieView", new RelayCommand(() => { AppFrame.Navigate(typeof(MovieView)); })); NavigationCommands.Add("OpenStudioView", new RelayCommand(() => { AppFrame.Navigate(typeof(StudioView)); })); }
/// <summary> /// Initializes a new instance of the AppShell, sets the static 'Current' reference, /// adds callbacks for Back requests and changes in the SplitView's DisplayMode, and /// provide the nav menu list with the data to display. /// </summary> public AppShell() { this.InitializeComponent(); this.Loaded += (sender, args) => { Current = this; this.TogglePaneButton.Focus(FocusState.Programmatic); this.NavigateToStartingPage(); SenseHatInputManager.Instance.Start(); SenseHatInputManager.Instance.DownPressed += async(s, a) => { await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { if (this.AppFrame.CurrentSourcePageType != typeof(DemoLauncherPage)) { AppFrame.Navigate(typeof(DemoLauncherPage), string.Empty, new Windows.UI.Xaml.Media.Animation.SuppressNavigationTransitionInfo()); } }); }; }; this.RootSplitView.RegisterPropertyChangedCallback( SplitView.DisplayModeProperty, (s, a) => { // Ensure that we update the reported size of the TogglePaneButton when the SplitView's // DisplayMode changes. this.CheckTogglePaneButtonSizeChanged(); }); SystemNavigationManager.GetForCurrentView().BackRequested += SystemNavigationManager_BackRequested; // If on a phone device that has hardware buttons then we hide the app's back button. if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) { this.BackButton.Visibility = Visibility.Collapsed; } NavMenuList.ItemsSource = navlist; }
/// <summary> /// Navigate to the Page for the selected <paramref name="listViewItem"/>. /// </summary> private void NavMenuList_ItemInvoked(object sender, ListViewItem listViewItem) { foreach (var i in PrimaryMenuItems) { i.IsSelected = false; } var item = (NavMenuItem)((NavMenuListView)sender).ItemFromContainer(listViewItem); if (item != null) { item.IsSelected = true; if (item.DestPage != null && item.DestPage != AppFrame.CurrentSourcePageType) { AppFrame.Navigate(item.DestPage, item.Arguments); } } }
public void NavigateToPage(Type page, object parameter = null) { if (LandingPage != null && LandingPage.Visibility == Visibility.Visible) { LandingPage.Visibility = Visibility.Collapsed; } var navItem = NavList.FirstOrDefault(n => n.DestPage == page); if (navItem != null) { NavMenuList.SelectedIndex = NavList.IndexOf(navItem); AppFrame.Navigate(navItem.DestPage, parameter); } else { AppFrame.Navigate(page, parameter); } }
private void OnListViewItemClicked(object sender, ItemClickEventArgs e) { var listViewItem = e.ClickedItem as TextBlock; var tag = listViewItem.Tag.ToString(); Type pageType = null; switch (tag) { case "LoadHTML": pageType = typeof(WebViewPage); break; case "LoadMailTo": pageType = typeof(MailTo.MailTo); break; } AppFrame.Navigate(pageType); }
protected override async void OnNavigatedTo(NavigationEventArgs e) { bool suppressNavigate = false; if ("suppressNavigate".Equals(e?.Parameter?.ToString())) { suppressNavigate = true; } // Navigate to WeatherNow page if (AppFrame.Content == null && !suppressNavigate) { AppFrame.Navigate(typeof(WeatherNow), e.Parameter); } // Setup background task Windows.ApplicationModel.Background.BackgroundExecutionManager.RemoveAccess(); await WeatherUpdateBackgroundTask.RegisterBackgroundTask(); }
/// <summary> /// Navigate to the Page for the selected <paramref name="listViewItem" />. /// </summary> /// <param name="sender">The sender.</param> /// <param name="listViewItem">The ListViewItem.</param> private void NavMenuList_ItemInvoked(object sender, ListViewItem listViewItem) { var item = (INavigationBarMenuItem)((NavMenuListView)sender).ItemFromContainer(listViewItem); if (item != null) { _telemetryClient.TrackEvent(TelemetryEvents.NavigationItemInvoked, new Dictionary <string, string> { { TelemetryProperties.NavigatingTo, item.DestPage.ToString() } }); if (item.DestPage != null && item.DestPage != AppFrame.CurrentSourcePageType) { AppFrame.Navigate(item.DestPage, item.Arguments); } } }
/// <summary> /// Navigate to the Page for the selected <paramref name="listViewItem" />. /// </summary> /// <param name="sender"></param> /// <param name="listViewItem"></param> private void NavMenuList_ItemInvoked(object sender, ListViewItem listViewItem) { var item = (NavMenuItem)((NavMenuListView)sender).ItemFromContainer(listViewItem); if (item?.DestPage != null && item.DestPage != AppFrame.CurrentSourcePageType) { AppFrame.Navigate(item.DestPage, item.Arguments); } //reset the bottom or top section depending on which section the user clicked if (sender.Equals(NavMenuListTop)) { NavMenuListBottom.SetSelectedItem(null); } else { NavMenuListTop.SetSelectedItem(null); } }