Пример #1
0
        public void GoBack()
        {
            if (!CanGoBack)
            {
                return;
            }
            var page = PageStack[PageIndex];
            var args = new HBNavigatingCancelEventArgs();

            page.OnNavigatingFrom(args);

            page.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            PageStack.Remove(page);
            FrameGrid.Children.Remove(page);

            page.OnNavigatedFrom(new HBNavigationEventArgs());

            GC.SuppressFinalize(page);
            GC.Collect();
            page.Content = null;
            page         = null;
            PageIndex--;
            if (PageIndex >= 0)
            {
                page = PageStack[PageIndex];
                //page.OnNavigatedTo(new HBNavigationEventArgs() { NavigationMode = NavigationMode.Back });
            }
            else
            {
                this.Visibility = Visibility.Collapsed;
            }
        }
Пример #2
0
 public virtual void OnNavigatingFrom(HBNavigatingCancelEventArgs e)
 {
     ViewModel.OnNavigatingFrom(e);
 }
Пример #3
0
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     base.OnNavigatingFrom(e);
     ViewModel?.OnNavigatingFrom(HBNavigatingCancelEventArgs.Convert(e));
 }
Пример #4
0
		public void GoBack()
		{
			if (!CanGoBack)
				return;
			var page = PageStack[PageIndex];
			var args = new HBNavigatingCancelEventArgs();
			page.OnNavigatingFrom(args);

			page.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
			PageStack.Remove(page);
			FrameGrid.Children.Remove(page);

			page.OnNavigatedFrom(new HBNavigationEventArgs());
			
			GC.SuppressFinalize(page);
			GC.Collect();
			page.Content = null;
			page = null;
			PageIndex--;
			if (PageIndex >= 0)
			{
				page = PageStack[PageIndex];
				//page.OnNavigatedTo(new HBNavigationEventArgs() { NavigationMode = NavigationMode.Back });
			}
			else {
				this.Visibility = Visibility.Collapsed;
			}
		}
Пример #5
0
		public virtual void OnNavigatingFrom(HBNavigatingCancelEventArgs e)
		{
			ViewModel.OnNavigatingFrom(e);
		}