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