From 2568abe980dcbf834f0f52a3839bc758644e52e8 Mon Sep 17 00:00:00 2001
From: d2dyno006 <53011783+d2dyno006@users.noreply.github.com>
Date: Tue, 6 Apr 2021 15:57:42 +0200
Subject: [PATCH 1/4] Dispose Homepage on navigation
---
Files/Extensions/FrameExtensions.cs | 49 +++++++++++++++++++
Files/Files.csproj | 1 +
.../UserControls/Widgets/DrivesWidget.xaml.cs | 1 -
.../UserControls/Widgets/LibraryCards.xaml.cs | 1 -
.../UserControls/Widgets/RecentFiles.xaml.cs | 1 -
Files/Views/ColumnShellPage.xaml.cs | 21 ++++----
Files/Views/ModernShellPage.xaml.cs | 23 ++++-----
Files/Views/YourHome.xaml.cs | 4 +-
8 files changed, 74 insertions(+), 27 deletions(-)
create mode 100644 Files/Extensions/FrameExtensions.cs
diff --git a/Files/Extensions/FrameExtensions.cs b/Files/Extensions/FrameExtensions.cs
new file mode 100644
index 000000000000..2765413a4a03
--- /dev/null
+++ b/Files/Extensions/FrameExtensions.cs
@@ -0,0 +1,49 @@
+using Files.Views;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Media.Animation;
+
+namespace Files.Extensions
+{
+ public static class FrameExtensions
+ {
+ ///
+ /// Wrapper function for that calls for current content page type
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool SafeNavigate(this Frame contentFrame, Type pageType, object parameter)
+ {
+ return SafeNavigate(contentFrame, pageType, parameter, new SuppressNavigationTransitionInfo());
+ }
+
+ ///
+ /// Wrapper function for that calls for current content page type
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool SafeNavigate(this Frame contentFrame, Type pageType, object parameter, NavigationTransitionInfo transitionInfo)
+ {
+ if (MustDispose(contentFrame.Content?.GetType(), pageType))
+ {
+ (contentFrame.Content as IDisposable)?.Dispose();
+ }
+
+ return contentFrame.Navigate(pageType, parameter, transitionInfo);
+ }
+
+ public static bool MustDispose(Type currentContent, Type incomingContent)
+ {
+ return currentContent == typeof(YourHome) && currentContent != incomingContent;
+ //return currentContent != incomingContent;
+ }
+ }
+}
diff --git a/Files/Files.csproj b/Files/Files.csproj
index 4cdd897077d0..3f30c20a508c 100644
--- a/Files/Files.csproj
+++ b/Files/Files.csproj
@@ -185,6 +185,7 @@
+
diff --git a/Files/UserControls/Widgets/DrivesWidget.xaml.cs b/Files/UserControls/Widgets/DrivesWidget.xaml.cs
index bb22eae7cc9e..dba66b65588f 100644
--- a/Files/UserControls/Widgets/DrivesWidget.xaml.cs
+++ b/Files/UserControls/Widgets/DrivesWidget.xaml.cs
@@ -172,7 +172,6 @@ private async void GoToStorageSense_Click(object sender, RoutedEventArgs e)
public void Dispose()
{
- Debugger.Break();
}
}
}
\ No newline at end of file
diff --git a/Files/UserControls/Widgets/LibraryCards.xaml.cs b/Files/UserControls/Widgets/LibraryCards.xaml.cs
index 77e26f2a3156..d8cfda871c4e 100644
--- a/Files/UserControls/Widgets/LibraryCards.xaml.cs
+++ b/Files/UserControls/Widgets/LibraryCards.xaml.cs
@@ -310,7 +310,6 @@ private async void DeleteLibrary_Click(object sender, RoutedEventArgs e)
public void Dispose()
{
- Debugger.Break();
}
}
diff --git a/Files/UserControls/Widgets/RecentFiles.xaml.cs b/Files/UserControls/Widgets/RecentFiles.xaml.cs
index ba2167aff529..e3e1fdcd0a20 100644
--- a/Files/UserControls/Widgets/RecentFiles.xaml.cs
+++ b/Files/UserControls/Widgets/RecentFiles.xaml.cs
@@ -213,7 +213,6 @@ private void ClearRecentItems_Click(object sender, RoutedEventArgs e)
public void Dispose()
{
- Debugger.Break();
}
}
diff --git a/Files/Views/ColumnShellPage.xaml.cs b/Files/Views/ColumnShellPage.xaml.cs
index 2fbd6467acbc..1a6a36309e13 100644
--- a/Files/Views/ColumnShellPage.xaml.cs
+++ b/Files/Views/ColumnShellPage.xaml.cs
@@ -2,6 +2,7 @@
using Files.Dialogs;
using Files.Enums;
using Files.EventArguments;
+using Files.Extensions;
using Files.Filesystem;
using Files.Filesystem.FilesystemHistory;
using Files.Filesystem.Search;
@@ -291,7 +292,7 @@ private async void ColumnShellPage_SearchSuggestionChosen(AutoSuggestBox sender,
var invokedItem = (args.SelectedItem as ListedItem);
if (invokedItem.PrimaryItemAttribute == StorageItemTypes.Folder)
{
- ItemDisplayFrame.Navigate(typeof(ColumnViewBase), new NavigationArguments()
+ ItemDisplayFrame.SafeNavigate(typeof(ColumnViewBase), new NavigationArguments()
{
NavPathParam = invokedItem.ItemPath,
AssociatedTabInstance = this
@@ -324,7 +325,7 @@ private async void ColumnShellPage_SearchQuerySubmitted(AutoSuggestBox sender, A
if (args.ChosenSuggestion == null && !string.IsNullOrWhiteSpace(args.QueryText))
{
FilesystemViewModel.IsLoadingIndicatorActive = true;
- ItemDisplayFrame.Navigate(typeof(ColumnViewBase), new NavigationArguments()
+ ItemDisplayFrame.SafeNavigate(typeof(ColumnViewBase), new NavigationArguments()
{
AssociatedTabInstance = this,
IsSearchResultPage = true,
@@ -548,7 +549,7 @@ private async Task SetPathBoxDropDownFlyoutAsync(MenuFlyout flyout, PathBoxItem
{
flyoutItem.Click += (sender, args) =>
{
- ItemDisplayFrame.Navigate(typeof(ColumnViewBase),
+ ItemDisplayFrame.SafeNavigate(typeof(ColumnViewBase),
new NavigationArguments()
{
NavPathParam = childFolder.Path,
@@ -563,7 +564,7 @@ private async Task SetPathBoxDropDownFlyoutAsync(MenuFlyout flyout, PathBoxItem
private void ColumnShellPage_NavigationRequested(object sender, PathNavigationEventArgs e)
{
- ItemDisplayFrame.Navigate(typeof(ColumnViewBase), new NavigationArguments()
+ ItemDisplayFrame.SafeNavigate(typeof(ColumnViewBase), new NavigationArguments()
{
NavPathParam = e.ItemPath,
AssociatedTabInstance = this
@@ -595,7 +596,7 @@ public async void CheckPathInput(ItemViewModel instance, string currentInput, st
if (currentInput.Equals("Home", StringComparison.OrdinalIgnoreCase)
|| currentInput.Equals("NewTab".GetLocalized(), StringComparison.OrdinalIgnoreCase))
{
- ItemDisplayFrame.Navigate(typeof(YourHome),
+ ItemDisplayFrame.SafeNavigate(typeof(YourHome),
new NavigationArguments()
{
NavPathParam = "NewTab".GetLocalized(),
@@ -617,7 +618,7 @@ public async void CheckPathInput(ItemViewModel instance, string currentInput, st
if (resFolder || FolderHelpers.CheckFolderAccessWithWin32(currentInput))
{
var pathToNavigate = resFolder.Result?.Path ?? currentInput;
- ItemDisplayFrame.Navigate(typeof(ColumnViewBase),
+ ItemDisplayFrame.SafeNavigate(typeof(ColumnViewBase),
new NavigationArguments()
{
NavPathParam = pathToNavigate,
@@ -761,7 +762,7 @@ private void OnNavigationParamsChanged()
{
if (string.IsNullOrEmpty(NavParams) || NavParams == "NewTab".GetLocalized() || NavParams == "Home")
{
- ItemDisplayFrame.Navigate(typeof(YourHome),
+ ItemDisplayFrame.SafeNavigate(typeof(YourHome),
new NavigationArguments()
{
NavPathParam = NavParams,
@@ -770,7 +771,7 @@ private void OnNavigationParamsChanged()
}
else
{
- ItemDisplayFrame.Navigate(typeof(ColumnViewBase),
+ ItemDisplayFrame.SafeNavigate(typeof(ColumnViewBase),
new NavigationArguments()
{
NavPathParam = NavParams,
@@ -1339,7 +1340,7 @@ public void NavigateToPath(string navigationPath, Type sourcePageType, Navigatio
{
if (navArgs != null && navArgs.AssociatedTabInstance != null)
{
- ItemDisplayFrame.Navigate(
+ ItemDisplayFrame.SafeNavigate(
sourcePageType = typeof(ColumnViewBase),
navArgs,
new SuppressNavigationTransitionInfo());
@@ -1355,7 +1356,7 @@ public void NavigateToPath(string navigationPath, Type sourcePageType, Navigatio
return;
}
- ItemDisplayFrame.Navigate(sourcePageType = typeof(ColumnViewBase),
+ ItemDisplayFrame.SafeNavigate(sourcePageType = typeof(ColumnViewBase),
new NavigationArguments()
{
NavPathParam = navigationPath,
diff --git a/Files/Views/ModernShellPage.xaml.cs b/Files/Views/ModernShellPage.xaml.cs
index dcfe0c4d682c..c0603e083f6d 100644
--- a/Files/Views/ModernShellPage.xaml.cs
+++ b/Files/Views/ModernShellPage.xaml.cs
@@ -3,6 +3,7 @@
using Files.Dialogs;
using Files.Enums;
using Files.EventArguments;
+using Files.Extensions;
using Files.Filesystem;
using Files.Filesystem.FilesystemHistory;
using Files.Filesystem.Search;
@@ -276,7 +277,7 @@ private async void ModernShellPage_SearchSuggestionChosen(AutoSuggestBox sender,
var invokedItem = (args.SelectedItem as ListedItem);
if (invokedItem.PrimaryItemAttribute == StorageItemTypes.Folder)
{
- ItemDisplayFrame.Navigate(InstanceViewModel.FolderSettings.GetLayoutType(invokedItem.ItemPath), new NavigationArguments()
+ ItemDisplayFrame.SafeNavigate(InstanceViewModel.FolderSettings.GetLayoutType(invokedItem.ItemPath), new NavigationArguments()
{
NavPathParam = invokedItem.ItemPath,
AssociatedTabInstance = this
@@ -309,7 +310,7 @@ private async void ModernShellPage_SearchQuerySubmitted(AutoSuggestBox sender, A
if (args.ChosenSuggestion == null && !string.IsNullOrWhiteSpace(args.QueryText))
{
FilesystemViewModel.IsLoadingIndicatorActive = true;
- ItemDisplayFrame.Navigate(InstanceViewModel.FolderSettings.GetLayoutType(FilesystemViewModel.WorkingDirectory), new NavigationArguments()
+ ItemDisplayFrame.SafeNavigate(InstanceViewModel.FolderSettings.GetLayoutType(FilesystemViewModel.WorkingDirectory), new NavigationArguments()
{
AssociatedTabInstance = this,
IsSearchResultPage = true,
@@ -532,7 +533,7 @@ private async Task SetPathBoxDropDownFlyoutAsync(MenuFlyout flyout, PathBoxItem
{
flyoutItem.Click += (sender, args) =>
{
- ItemDisplayFrame.Navigate(InstanceViewModel.FolderSettings.GetLayoutType(childFolder.Path),
+ ItemDisplayFrame.SafeNavigate(InstanceViewModel.FolderSettings.GetLayoutType(childFolder.Path),
new NavigationArguments()
{
NavPathParam = childFolder.Path,
@@ -547,7 +548,7 @@ private async Task SetPathBoxDropDownFlyoutAsync(MenuFlyout flyout, PathBoxItem
private void ModernShellPage_NavigationRequested(object sender, PathNavigationEventArgs e)
{
- ItemDisplayFrame.Navigate(InstanceViewModel.FolderSettings.GetLayoutType(e.ItemPath), new NavigationArguments()
+ ItemDisplayFrame.SafeNavigate(InstanceViewModel.FolderSettings.GetLayoutType(e.ItemPath), new NavigationArguments()
{
NavPathParam = e.ItemPath,
AssociatedTabInstance = this
@@ -579,7 +580,7 @@ public async void CheckPathInput(ItemViewModel instance, string currentInput, st
if (currentInput.Equals("Home", StringComparison.OrdinalIgnoreCase)
|| currentInput.Equals("NewTab".GetLocalized(), StringComparison.OrdinalIgnoreCase))
{
- ItemDisplayFrame.Navigate(typeof(YourHome),
+ ItemDisplayFrame.SafeNavigate(typeof(YourHome),
new NavigationArguments()
{
NavPathParam = "NewTab".GetLocalized(),
@@ -601,7 +602,7 @@ public async void CheckPathInput(ItemViewModel instance, string currentInput, st
if (resFolder || FolderHelpers.CheckFolderAccessWithWin32(currentInput))
{
var pathToNavigate = resFolder.Result?.Path ?? currentInput;
- ItemDisplayFrame.Navigate(InstanceViewModel.FolderSettings.GetLayoutType(pathToNavigate),
+ ItemDisplayFrame.SafeNavigate(InstanceViewModel.FolderSettings.GetLayoutType(pathToNavigate),
new NavigationArguments()
{
NavPathParam = pathToNavigate,
@@ -744,7 +745,7 @@ private void OnNavigationParamsChanged()
{
if (string.IsNullOrEmpty(NavParams) || NavParams == "NewTab".GetLocalized() || NavParams == "Home")
{
- ItemDisplayFrame.Navigate(typeof(YourHome),
+ ItemDisplayFrame.SafeNavigate(typeof(YourHome),
new NavigationArguments()
{
NavPathParam = NavParams,
@@ -753,7 +754,7 @@ private void OnNavigationParamsChanged()
}
else
{
- ItemDisplayFrame.Navigate(InstanceViewModel.FolderSettings.GetLayoutType(NavParams),
+ ItemDisplayFrame.SafeNavigate(InstanceViewModel.FolderSettings.GetLayoutType(NavParams),
new NavigationArguments()
{
NavPathParam = NavParams,
@@ -1126,7 +1127,7 @@ public void Up_Click()
}
SelectSidebarItemFromPath();
- ItemDisplayFrame.Navigate(InstanceViewModel.FolderSettings.GetLayoutType(parentDirectoryOfPath),
+ ItemDisplayFrame.SafeNavigate(InstanceViewModel.FolderSettings.GetLayoutType(parentDirectoryOfPath),
new NavigationArguments()
{
NavPathParam = parentDirectoryOfPath,
@@ -1385,7 +1386,7 @@ public void NavigateToPath(string navigationPath, Type sourcePageType, Navigatio
{
if (navArgs != null && navArgs.AssociatedTabInstance != null)
{
- ItemDisplayFrame.Navigate(
+ ItemDisplayFrame.SafeNavigate(
sourcePageType == null ? InstanceViewModel.FolderSettings.GetLayoutType(navigationPath) : sourcePageType,
navArgs,
new SuppressNavigationTransitionInfo());
@@ -1408,7 +1409,7 @@ public void NavigateToPath(string navigationPath, Type sourcePageType, Navigatio
transition = new DrillInNavigationTransitionInfo();
}
- ItemDisplayFrame.Navigate(
+ ItemDisplayFrame.SafeNavigate(
sourcePageType == null ? InstanceViewModel.FolderSettings.GetLayoutType(navigationPath) : sourcePageType,
new NavigationArguments()
{
diff --git a/Files/Views/YourHome.xaml.cs b/Files/Views/YourHome.xaml.cs
index 97fd3117cf47..456497f9d5fb 100644
--- a/Files/Views/YourHome.xaml.cs
+++ b/Files/Views/YourHome.xaml.cs
@@ -16,9 +16,7 @@ namespace Files.Views
public sealed partial class YourHome : Page, IDisposable
{
private IShellPage AppInstance = null;
- public SettingsViewModel AppSettings => App.AppSettings;
public FolderSettingsViewModel FolderSettings => AppInstance?.InstanceViewModel.FolderSettings;
- public NamedPipeAsAppServiceConnection Connection => AppInstance?.ServiceConnection;
LibraryCards libraryCards;
DrivesWidget drivesWidget;
@@ -112,7 +110,7 @@ private async void RecentFilesWidget_RecentFileInvoked(object sender, UserContro
}
else
{
- foreach (DriveItem drive in Enumerable.Concat(App.DrivesManager.Drives, AppSettings.CloudDrivesManager.Drives))
+ foreach (DriveItem drive in Enumerable.Concat(App.DrivesManager.Drives, App.AppSettings.CloudDrivesManager.Drives))
{
if (drive.Path.ToString() == new DirectoryInfo(e.ItemPath).Root.ToString())
{
From 46bddcd8d457aa7eee7075f3f6be8c6203a4089a Mon Sep 17 00:00:00 2001
From: d2dyno006 <53011783+d2dyno006@users.noreply.github.com>
Date: Tue, 6 Apr 2021 15:58:04 +0200
Subject: [PATCH 2/4] Removed comment
---
Files/Views/YourHome.xaml.cs | 2 --
1 file changed, 2 deletions(-)
diff --git a/Files/Views/YourHome.xaml.cs b/Files/Views/YourHome.xaml.cs
index 456497f9d5fb..1d38ef884d89 100644
--- a/Files/Views/YourHome.xaml.cs
+++ b/Files/Views/YourHome.xaml.cs
@@ -209,8 +209,6 @@ protected override async void OnNavigatedTo(NavigationEventArgs eventArgs)
#region IDisposable
- // TODO: This Dispose() is never called, please implement the functionality to call this function.
- // This IDisposable.Dispose() needs to be called to unhook events in BundlesWidget to avoid memory leaks.
public void Dispose()
{
Widgets?.Dispose();
From 0ccfdf5e326b564e97dace44822be26f424b0124 Mon Sep 17 00:00:00 2001
From: d2dyno006 <53011783+d2dyno006@users.noreply.github.com>
Date: Fri, 9 Apr 2021 21:09:10 +0200
Subject: [PATCH 3/4] Quick changes
---
Files/Extensions/FrameExtensions.cs | 49 -----------------------------
Files/Files.csproj | 1 -
Files/Views/YourHome.xaml.cs | 7 +++++
3 files changed, 7 insertions(+), 50 deletions(-)
delete mode 100644 Files/Extensions/FrameExtensions.cs
diff --git a/Files/Extensions/FrameExtensions.cs b/Files/Extensions/FrameExtensions.cs
deleted file mode 100644
index 2765413a4a03..000000000000
--- a/Files/Extensions/FrameExtensions.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using Files.Views;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Media.Animation;
-
-namespace Files.Extensions
-{
- public static class FrameExtensions
- {
- ///
- /// Wrapper function for that calls for current content page type
- ///
- ///
- ///
- ///
- ///
- public static bool SafeNavigate(this Frame contentFrame, Type pageType, object parameter)
- {
- return SafeNavigate(contentFrame, pageType, parameter, new SuppressNavigationTransitionInfo());
- }
-
- ///
- /// Wrapper function for that calls for current content page type
- ///
- ///
- ///
- ///
- ///
- public static bool SafeNavigate(this Frame contentFrame, Type pageType, object parameter, NavigationTransitionInfo transitionInfo)
- {
- if (MustDispose(contentFrame.Content?.GetType(), pageType))
- {
- (contentFrame.Content as IDisposable)?.Dispose();
- }
-
- return contentFrame.Navigate(pageType, parameter, transitionInfo);
- }
-
- public static bool MustDispose(Type currentContent, Type incomingContent)
- {
- return currentContent == typeof(YourHome) && currentContent != incomingContent;
- //return currentContent != incomingContent;
- }
- }
-}
diff --git a/Files/Files.csproj b/Files/Files.csproj
index 3f30c20a508c..4cdd897077d0 100644
--- a/Files/Files.csproj
+++ b/Files/Files.csproj
@@ -185,7 +185,6 @@
-
diff --git a/Files/Views/YourHome.xaml.cs b/Files/Views/YourHome.xaml.cs
index 1d38ef884d89..c9e05f4ed22b 100644
--- a/Files/Views/YourHome.xaml.cs
+++ b/Files/Views/YourHome.xaml.cs
@@ -29,6 +29,13 @@ public YourHome()
this.Loaded += YourHome_Loaded;
}
+ protected override void OnNavigatedFrom(NavigationEventArgs e)
+ {
+ this.Dispose();
+
+ base.OnNavigatedFrom(e);
+ }
+
private async void YourHome_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
libraryCards = WidgetsHelpers.TryGetWidget(Widgets.ViewModel, libraryCards);
From 762e40b65678441baf94333917e20f903fced449 Mon Sep 17 00:00:00 2001
From: d2dyno006 <53011783+d2dyno006@users.noreply.github.com>
Date: Fri, 9 Apr 2021 21:12:28 +0200
Subject: [PATCH 4/4] Fix build
---
Files/Views/ColumnShellPage.xaml.cs | 14 +++++++-------
Files/Views/ModernShellPage.xaml.cs | 16 ++++++++--------
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/Files/Views/ColumnShellPage.xaml.cs b/Files/Views/ColumnShellPage.xaml.cs
index d1f926a2b5b6..88b919ec5cb4 100644
--- a/Files/Views/ColumnShellPage.xaml.cs
+++ b/Files/Views/ColumnShellPage.xaml.cs
@@ -289,7 +289,7 @@ private async void ColumnShellPage_SearchSuggestionChosen(AutoSuggestBox sender,
var invokedItem = (args.SelectedItem as ListedItem);
if (invokedItem.PrimaryItemAttribute == StorageItemTypes.Folder)
{
- ItemDisplayFrame.SafeNavigate(typeof(ColumnViewBase), new NavigationArguments()
+ ItemDisplayFrame.Navigate(typeof(ColumnViewBase), new NavigationArguments()
{
NavPathParam = invokedItem.ItemPath,
AssociatedTabInstance = this
@@ -537,7 +537,7 @@ private async Task SetPathBoxDropDownFlyoutAsync(MenuFlyout flyout, PathBoxItem
{
flyoutItem.Click += (sender, args) =>
{
- ItemDisplayFrame.SafeNavigate(typeof(ColumnViewBase),
+ ItemDisplayFrame.Navigate(typeof(ColumnViewBase),
new NavigationArguments()
{
NavPathParam = childFolder.Path,
@@ -552,7 +552,7 @@ private async Task SetPathBoxDropDownFlyoutAsync(MenuFlyout flyout, PathBoxItem
private void ColumnShellPage_NavigationRequested(object sender, PathNavigationEventArgs e)
{
- ItemDisplayFrame.SafeNavigate(typeof(ColumnViewBase), new NavigationArguments()
+ ItemDisplayFrame.Navigate(typeof(ColumnViewBase), new NavigationArguments()
{
NavPathParam = e.ItemPath,
AssociatedTabInstance = this
@@ -606,7 +606,7 @@ public async void CheckPathInput(ItemViewModel instance, string currentInput, st
if (resFolder || FolderHelpers.CheckFolderAccessWithWin32(currentInput))
{
var pathToNavigate = resFolder.Result?.Path ?? currentInput;
- ItemDisplayFrame.SafeNavigate(typeof(ColumnViewBase),
+ ItemDisplayFrame.Navigate(typeof(ColumnViewBase),
new NavigationArguments()
{
NavPathParam = pathToNavigate,
@@ -759,7 +759,7 @@ private void OnNavigationParamsChanged()
}
else
{
- ItemDisplayFrame.SafeNavigate(typeof(ColumnViewBase),
+ ItemDisplayFrame.Navigate(typeof(ColumnViewBase),
new NavigationArguments()
{
NavPathParam = NavParams,
@@ -1328,7 +1328,7 @@ public void NavigateToPath(string navigationPath, Type sourcePageType, Navigatio
{
if (navArgs != null && navArgs.AssociatedTabInstance != null)
{
- ItemDisplayFrame.SafeNavigate(
+ ItemDisplayFrame.Navigate(
sourcePageType = typeof(ColumnViewBase),
navArgs,
new SuppressNavigationTransitionInfo());
@@ -1344,7 +1344,7 @@ public void NavigateToPath(string navigationPath, Type sourcePageType, Navigatio
return;
}
- ItemDisplayFrame.SafeNavigate(sourcePageType = typeof(ColumnViewBase),
+ ItemDisplayFrame.Navigate(sourcePageType = typeof(ColumnViewBase),
new NavigationArguments()
{
NavPathParam = navigationPath,
diff --git a/Files/Views/ModernShellPage.xaml.cs b/Files/Views/ModernShellPage.xaml.cs
index 508808183565..e615588c4358 100644
--- a/Files/Views/ModernShellPage.xaml.cs
+++ b/Files/Views/ModernShellPage.xaml.cs
@@ -282,7 +282,7 @@ private async void ModernShellPage_SearchSuggestionChosen(AutoSuggestBox sender,
var invokedItem = (args.SelectedItem as ListedItem);
if (invokedItem.PrimaryItemAttribute == StorageItemTypes.Folder)
{
- ItemDisplayFrame.SafeNavigate(InstanceViewModel.FolderSettings.GetLayoutType(invokedItem.ItemPath), new NavigationArguments()
+ ItemDisplayFrame.Navigate(InstanceViewModel.FolderSettings.GetLayoutType(invokedItem.ItemPath), new NavigationArguments()
{
NavPathParam = invokedItem.ItemPath,
AssociatedTabInstance = this
@@ -546,7 +546,7 @@ private async Task SetPathBoxDropDownFlyoutAsync(MenuFlyout flyout, PathBoxItem
{
flyoutItem.Click += (sender, args) =>
{
- ItemDisplayFrame.SafeNavigate(InstanceViewModel.FolderSettings.GetLayoutType(childFolder.Path),
+ ItemDisplayFrame.Navigate(InstanceViewModel.FolderSettings.GetLayoutType(childFolder.Path),
new NavigationArguments()
{
NavPathParam = childFolder.Path,
@@ -561,7 +561,7 @@ private async Task SetPathBoxDropDownFlyoutAsync(MenuFlyout flyout, PathBoxItem
private void ModernShellPage_NavigationRequested(object sender, PathNavigationEventArgs e)
{
- ItemDisplayFrame.SafeNavigate(InstanceViewModel.FolderSettings.GetLayoutType(e.ItemPath), new NavigationArguments()
+ ItemDisplayFrame.Navigate(InstanceViewModel.FolderSettings.GetLayoutType(e.ItemPath), new NavigationArguments()
{
NavPathParam = e.ItemPath,
AssociatedTabInstance = this
@@ -615,7 +615,7 @@ public async void CheckPathInput(ItemViewModel instance, string currentInput, st
if (resFolder || FolderHelpers.CheckFolderAccessWithWin32(currentInput))
{
var pathToNavigate = resFolder.Result?.Path ?? currentInput;
- ItemDisplayFrame.SafeNavigate(InstanceViewModel.FolderSettings.GetLayoutType(pathToNavigate),
+ ItemDisplayFrame.Navigate(InstanceViewModel.FolderSettings.GetLayoutType(pathToNavigate),
new NavigationArguments()
{
NavPathParam = pathToNavigate,
@@ -767,7 +767,7 @@ private void OnNavigationParamsChanged()
}
else
{
- ItemDisplayFrame.SafeNavigate(InstanceViewModel.FolderSettings.GetLayoutType(NavParams),
+ ItemDisplayFrame.Navigate(InstanceViewModel.FolderSettings.GetLayoutType(NavParams),
new NavigationArguments()
{
NavPathParam = NavParams,
@@ -1140,7 +1140,7 @@ public void Up_Click()
}
SelectSidebarItemFromPath();
- ItemDisplayFrame.SafeNavigate(InstanceViewModel.FolderSettings.GetLayoutType(parentDirectoryOfPath),
+ ItemDisplayFrame.Navigate(InstanceViewModel.FolderSettings.GetLayoutType(parentDirectoryOfPath),
new NavigationArguments()
{
NavPathParam = parentDirectoryOfPath,
@@ -1403,7 +1403,7 @@ public void NavigateToPath(string navigationPath, Type sourcePageType, Navigatio
{
if (navArgs != null && navArgs.AssociatedTabInstance != null)
{
- ItemDisplayFrame.SafeNavigate(
+ ItemDisplayFrame.Navigate(
sourcePageType == null ? InstanceViewModel.FolderSettings.GetLayoutType(navigationPath) : sourcePageType,
navArgs,
new SuppressNavigationTransitionInfo());
@@ -1426,7 +1426,7 @@ public void NavigateToPath(string navigationPath, Type sourcePageType, Navigatio
transition = new DrillInNavigationTransitionInfo();
}
- ItemDisplayFrame.SafeNavigate(
+ ItemDisplayFrame.Navigate(
sourcePageType == null ? InstanceViewModel.FolderSettings.GetLayoutType(navigationPath) : sourcePageType,
new NavigationArguments()
{