private void AddNewPageToGridIfNotSequential(PageInsertionMode insertionMode, MtPageDescription newPage) { if (insertionMode == PageInsertionMode.ConcurrentAbove) { ContentGrid.Children.Add(newPage.GetPage(this).InternalPage); } else if (insertionMode == PageInsertionMode.ConcurrentBelow) { ContentGrid.Children.Insert(0, newPage.GetPage(this).InternalPage); } }
private void RaisePageOnNavigatedTo(MtPageDescription description, NavigationMode mode) { var page = description.GetPage(this); var args = new MtNavigationEventArgs(); args.Content = page; args.SourcePageType = description.Type; args.Parameter = description.Parameter; args.NavigationMode = mode; page.OnNavigatedToCore(args); var copy = Navigated; if (copy != null) { copy(this, args); } OnNavigated(this, args); if (args.NavigationMode == NavigationMode.New) { OnPageCreated(this, page); } }
private async Task <bool> RaisePageOnNavigatingFromAsync(MtPageDescription currentPage, MtPageDescription nextPage, NavigationMode mode) { var page = currentPage.GetPage(this); var args = new MtNavigatingCancelEventArgs(); args.Content = page; args.SourcePageType = currentPage.Type; args.NavigationMode = mode; args.Parameter = currentPage.Parameter; await page.OnNavigatingFromCoreAsync(args); if (!args.Cancel && nextPage != null) { var args2 = new MtNavigatingCancelEventArgs(); args2.SourcePageType = nextPage.Type; args2.NavigationMode = mode; args2.Parameter = nextPage.Parameter; var copy = Navigating; if (copy != null) { copy(this, args2); args.Cancel = args2.Cancel; } } return(args.Cancel); }
private async Task AnimateNavigatedFromIfCurrentPageNotNull(IPageAnimation pageAnimation, NavigationMode navigationMode, PageInsertionMode insertionMode, MtPageDescription currentPage, MtPageDescription newPage) { if (currentPage != null) { if (insertionMode != PageInsertionMode.Sequential) { await AnimateNavigatingFromAsync(pageAnimation, navigationMode, currentPage.GetPage(this).ActualAnimationContext, insertionMode != PageInsertionMode.Sequential?newPage.GetPage(this).ActualAnimationContext : null); } else { await AnimateNavigatingFromAsync(pageAnimation, navigationMode, currentPage.GetPage(this).ActualAnimationContext, null); } } }
private async Task AnimateNavigatedToAndRemoveCurrentPageAsync(IPageAnimation pageAnimation, NavigationMode navigationMode, PageInsertionMode insertionMode, MtPageDescription currentPage, MtPageDescription newPage) { if (currentPage != null) { if (insertionMode != PageInsertionMode.Sequential) { await AnimateNavigatedToAsync(pageAnimation, navigationMode, currentPage.GetPage(this).ActualAnimationContext, newPage.GetPage(this).ActualAnimationContext); ContentGrid.Children.Remove(currentPage.GetPage(this).InternalPage); } else { await AnimateNavigatedToAsync(pageAnimation, navigationMode, null, newPage.GetPage(this).ActualAnimationContext); } } }
private void SwitchPagesIfSequential(PageInsertionMode insertionMode, MtPageDescription currentPage, MtPageDescription newPage) { if (insertionMode == PageInsertionMode.Sequential) { if (currentPage != null) { ContentGrid.Children.Remove(currentPage.GetPage(this).InternalPage); } ContentGrid.Children.Add(newPage.GetPage(this).InternalPage); } }
private void RaisePageOnNavigatedFrom(MtPageDescription description, NavigationMode mode) { var page = description.GetPage(this); var args = new MtNavigationEventArgs(); args.Content = page; args.SourcePageType = description.Type; args.Parameter = description.Parameter; args.NavigationMode = mode; page.OnNavigatedFromCore(args); }
private async Task <bool> RaisePageOnNavigatingFromAsync(MtPageDescription description, NavigationMode mode) { var page = description.GetPage(this); var args = new MtNavigatingCancelEventArgs(); args.Content = page; args.SourcePageType = description.Type; args.NavigationMode = mode; IsNavigating = true; await page.OnNavigatingFromCoreAsync(args); IsNavigating = false; return(args.Cancel); }
private void RaisePageOnNavigatedTo(MtPageDescription description, NavigationMode mode) { var page = description.GetPage(this); var args = new MtNavigationEventArgs(); args.Content = page; args.SourcePageType = description.Type; args.Parameter = description.Parameter; args.NavigationMode = mode; page.OnNavigatedToCore(args); var copy = Navigated; if (copy != null) copy(this, args); OnNavigated(this, args); if (args.NavigationMode == NavigationMode.New) OnPageCreated(this, page); }
private async Task<bool> RaisePageOnNavigatingFromAsync(MtPageDescription description, NavigationMode mode) { var page = description.GetPage(this); var args = new MtNavigatingCancelEventArgs(); args.Content = page; args.SourcePageType = description.Type; args.NavigationMode = mode; IsNavigating = true; await page.OnNavigatingFromCoreAsync(args); IsNavigating = false; return args.Cancel; }
internal void RaisePageOnNavigatedFrom(MtPageDescription description, NavigationMode mode) { var page = description.GetPage(this); var args = new MtNavigationEventArgs(); args.Content = page; args.SourcePageType = description.Type; args.Parameter = description.Parameter; args.NavigationMode = mode; page.OnNavigatedFromCore(args); }
private void SwitchPagesIfSequential(PageInsertionMode insertionMode, MtPageDescription currentPage, MtPageDescription newPage) { if (insertionMode == PageInsertionMode.Sequential) { if (currentPage != null) ContentGrid.Children.Remove(currentPage.GetPage(this).InternalPage); ContentGrid.Children.Add(newPage.GetPage(this).InternalPage); } }
private async Task AnimateNavigatedFromIfCurrentPageNotNull(IPageAnimation pageAnimation, NavigationMode navigationMode, PageInsertionMode insertionMode, MtPageDescription currentPage, MtPageDescription newPage) { if (currentPage != null) { if (insertionMode != PageInsertionMode.Sequential) { await AnimateNavigatingFromAsync(pageAnimation, navigationMode, currentPage.GetPage(this).ActualAnimationContext, insertionMode != PageInsertionMode.Sequential ? newPage.GetPage(this).ActualAnimationContext : null); } else { await AnimateNavigatingFromAsync(pageAnimation, navigationMode, currentPage.GetPage(this).ActualAnimationContext, null); } } }
private void AddNewPageToGridIfNotSequential(PageInsertionMode insertionMode, MtPageDescription newPage) { if (insertionMode == PageInsertionMode.ConcurrentAbove) ContentGrid.Children.Add(newPage.GetPage(this).InternalPage); else if (insertionMode == PageInsertionMode.ConcurrentBelow) ContentGrid.Children.Insert(0, newPage.GetPage(this).InternalPage); }
private async Task<bool> RaisePageOnNavigatingFromAsync(MtPageDescription currentPage, MtPageDescription targetPage, NavigationMode mode) { var page = currentPage.GetPage(this); var args = new MtNavigatingCancelEventArgs(); args.Content = page; args.SourcePageType = currentPage.Type; args.NavigationMode = mode; args.Parameter = currentPage.Parameter; await page.OnNavigatingFromCoreAsync(args); if (!args.Cancel && targetPage != null) { var args2 = new MtNavigatingCancelEventArgs(); args2.SourcePageType = targetPage.Type; args2.NavigationMode = mode; args2.Parameter = targetPage.Parameter; var copy = Navigating; if (copy != null) { copy(this, args2); args.Cancel = args2.Cancel; } } return args.Cancel; }