private void ViewSchedule_OnClicked(object sender, RoutedEventArgs e) { PlantViewModel viewModel = (PlantViewModel)DataContext; Pages requestpage = (Pages)Enum.Parse(typeof(Pages), "FullScheduleView"); NavigationEvents.RequestPage(requestpage, viewModel.Plant.Id); }
private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { var pageName = ((sender as ListView).SelectedItem).ToString(); Pages requestPage = (Pages)Enum.Parse(typeof(Pages), pageName); NavigationEvents.RequestPage(requestPage); }
/// <summary> /// Initializes a new instance of the <see cref="XslExtensions"/> class. /// </summary> public XslExtensions() { this.shoppingCartEvents = new ShoppingCartEvents(); this.checkoutEvents = new CheckoutEvents(); this.authentificationEvents = new AuthentificationEvents(); this.navigationEvents = new NavigationEvents(); }
private void Save(object obj) { if (Plant.Save()) { NavigationEvents.RequestPage(Pages.Back); } }
private void OnNavigated(object oldContent, object newContent, NavigationEventArgs e) { // invoke IContent.OnNavigatedFrom and OnNavigatedTo if (oldContent != null) { var content = oldContent as INavigationView; if (content != null) { content.OnNavigatedFrom(e); } // first invoke child frame navigation events foreach (var f in GetChildFrames()) { f.OnNavigated(f.Content, null, new NavigationEventArgs(f, null, NavigationType.Parent, null)); } } if (newContent != null) { var content = newContent as INavigationView; if (content != null) { content.OnNavigatedTo(e); } } // raise the Navigated event var handler = this.Navigated; if (handler != null) { handler(this, e); } NavigationEvents.OnNavigated(this, e); }
/// <summary> /// Initializes a new instance of the <see cref="XslExtensions"/> class. /// </summary> public XslExtensions() { this.shoppingCartEvents = new ShoppingCartEvents(); this.checkoutEvents = new CheckoutEvents(); this.authentificationEvents = new AuthentificationEvents(); this.navigationEvents = new NavigationEvents(); }
private void OnNavigating(object content, NavigatingCancelEventArgs e) { // first invoke child frame navigation events foreach (var f in GetChildFrames()) { var navigatingCancelEventArgs = new NavigatingCancelEventArgs(f, null, true, NavigationType.Parent); f.OnNavigating(f.Content, navigatingCancelEventArgs); if (navigatingCancelEventArgs.Cancel) { e.Cancel = true; return; } } // invoke ICancelNavigation.OnNavigating (only if content implements ICancelNavigation) var c = content as ICancelNavigation; if (c != null) { c.OnNavigatingFrom(e); } // raise the Navigating event var handler = this.Navigating; if (handler != null) { handler(this, e); } NavigationEvents.OnNavigating(this, e); }
private static void AddToLog(string message) { if (NavigationEvents.Count == 8) { NavigationEvents.Clear(); } NavigationEvents.Add(message); }
private void OnNavigationFailed(NavigationFailedEventArgs e) { var handler = this.NavigationFailed; if (handler != null) { handler(this, e); } NavigationEvents.OnNavigationFailed(this, e); }
private void OnPlantSelected(object sender, SelectionChangedEventArgs e) { if ((sender as ListView).SelectedIndex == (sender as ListView).Items.Count - 1) { return; } Plant selectedPlant = (Plant)(sender as ListView).SelectedItem; NavigationEvents.RequestPage(Pages.Plant, selectedPlant.Id); }
public static void DisableNavigationLogging(this PhoneApplicationPage page) { page.NavigationService.FragmentNavigation -= NavigationService_FragmentNavigation; page.NavigationService.JournalEntryRemoved -= NavigationService_JournalEntryRemoved; page.NavigationService.Navigated -= NavigationService_Navigated; page.NavigationService.Navigating -= NavigationService_Navigating; page.NavigationService.NavigationFailed -= NavigationService_NavigationFailed; page.NavigationService.NavigationStopped -= NavigationService_NavigationStopped; NavigationEvents.Clear(); }
private void SaveReport(object obj) { Progress progress = new Progress() { PlantId = Plant.Id, Notes = Notes, Image = ImagePath, WeekNum = Plant.Week, ScheduleID = Plant.ScheduleId, Date = DateTime.Now }; if (progress.Save()) { NavigationEvents.RequestPage(Pages.Back); } }
private void OnFragmentNavigation(object content, FragmentNavigationEventArgs e) { var c = content as INavigationView; // invoke optional IContent.OnFragmentNavigation if (c != null) { c.OnFragmentNavigation(e); } // raise the FragmentNavigation event var handler = this.FragmentNavigation; if (handler != null) { handler(this, e); } NavigationEvents.OnFragmentNavigation(this, e); }
private void ClosePage(object obj) { Guards.ArgumentGuard(obj); NavigationEvents.RequestPage(Pages.Back); }
private void Cancel(object obj) { NavigationEvents.RequestPage(Pages.Back); }
private void OnPlantSelected(object sender, SelectionChangedEventArgs e) { Plant selectedPlant = (Plant)(sender as ListView).SelectedItem; NavigationEvents.RequestPage(Pages.Plant, selectedPlant.Id); }
private void AddPlant(object obj) { EditPlantViewModel viewModel = new EditPlantViewModel(); NavigationEvents.RequestPage(Pages.EditablePlant, viewModel); }
private void ViewSchedule(object obj) { NavigationEvents.RequestPage(Pages.FullScheduleView, Plant.ScheduleId); }
private void CreateProgressReport(object obj) { AddProgressReportViewModel viewModel = new AddProgressReportViewModel(Plant); NavigationEvents.RequestPage(Pages.CreateProgressReport, viewModel); }
private void ViewProgress(object obj) { NavigationEvents.RequestPage(Pages.ProgressReportCollection, Plant.Id); }