@@ -12,6 +12,7 @@ namespace Files.App.Helpers
12
12
{
13
13
public static class NavigationHelpers
14
14
{
15
+ private static readonly IWindowsRecentItemsService WindowsRecentItemsService = Ioc . Default . GetRequiredService < IWindowsRecentItemsService > ( ) ;
15
16
private static MainPageViewModel MainPageViewModel { get ; } = Ioc . Default . GetRequiredService < MainPageViewModel > ( ) ;
16
17
private static DrivesViewModel DrivesViewModel { get ; } = Ioc . Default . GetRequiredService < DrivesViewModel > ( ) ;
17
18
private static INetworkService NetworkService { get ; } = Ioc . Default . GetRequiredService < INetworkService > ( ) ;
@@ -524,7 +525,7 @@ private static async Task<FilesystemResult> OpenDirectory(string path, IShellPag
524
525
{
525
526
// Add location to Recent Items List
526
527
if ( childFolder . Item is SystemStorageFolder )
527
- App . RecentItemsManager . AddToRecentItems ( childFolder . Path ) ;
528
+ WindowsRecentItemsService . Add ( childFolder . Path ) ;
528
529
} ) ;
529
530
if ( ! opened )
530
531
opened = ( FilesystemResult ) FolderHelpers . CheckFolderAccessWithWin32 ( path ) ;
@@ -556,7 +557,7 @@ private static async Task<FilesystemResult> OpenFile(string path, IShellPage ass
556
557
StorageFileWithPath childFile = await associatedInstance . ShellViewModel . GetFileWithPathFromPathAsync ( shortcutInfo . TargetPath ) ;
557
558
// Add location to Recent Items List
558
559
if ( childFile ? . Item is SystemStorageFile )
559
- App . RecentItemsManager . AddToRecentItems ( childFile . Path ) ;
560
+ WindowsRecentItemsService . Add ( childFile . Path ) ;
560
561
}
561
562
await Win32Helper . InvokeWin32ComponentAsync ( shortcutInfo . TargetPath , associatedInstance , $ "{ args } { shortcutInfo . Arguments } ", shortcutInfo . RunAsAdmin , shortcutInfo . WorkingDirectory ) ;
562
563
}
@@ -573,7 +574,7 @@ private static async Task<FilesystemResult> OpenFile(string path, IShellPage ass
573
574
{
574
575
// Add location to Recent Items List
575
576
if ( childFile . Item is SystemStorageFile )
576
- App . RecentItemsManager . AddToRecentItems ( childFile . Path ) ;
577
+ WindowsRecentItemsService . Add ( childFile . Path ) ;
577
578
578
579
if ( openViaApplicationPicker )
579
580
{
0 commit comments