BaconographyWP8.View.LinkedPictureView.OnNavigatedFrom C# (CSharp) Method

OnNavigatedFrom() protected method

protected OnNavigatedFrom ( System.Windows.Navigation.NavigationEventArgs e ) : void
e System.Windows.Navigation.NavigationEventArgs
return void
		protected override void OnNavigatedFrom(NavigationEventArgs e)
		{
            if(e.NavigationMode == NavigationMode.Back)
                CleanupImageSource();

            if (e.NavigationMode == NavigationMode.New && e.IsNavigationInitiator)
            {
                
                var absPath = e.Uri.ToString().Contains('?') ? e.Uri.ToString().Substring(0, e.Uri.ToString().IndexOf("?")) : e.Uri.ToString();
                if (absPath == "/BaconographyWP8Core;component/View/LinkedPictureView.xaml" || absPath == "/BaconographyWP8Core;component/View/LinkedReadabilityView.xaml" ||
                    absPath == "/BaconographyWP8Core;component/View/LinkedSelfTextPageView.xaml")
                {
                    CleanupImageSource();
                    ServiceLocator.Current.GetInstance<INavigationService>().RemoveBackEntry();
                }
            }
		}