@@ -12,6 +12,7 @@ namespace Files.App.Helpers
1212{
1313 public static class NavigationHelpers
1414 {
15+ private static readonly IWindowsRecentItemsService WindowsRecentItemsService = Ioc . Default . GetRequiredService < IWindowsRecentItemsService > ( ) ;
1516 private static MainPageViewModel MainPageViewModel { get ; } = Ioc . Default . GetRequiredService < MainPageViewModel > ( ) ;
1617 private static DrivesViewModel DrivesViewModel { get ; } = Ioc . Default . GetRequiredService < DrivesViewModel > ( ) ;
1718 private static INetworkService NetworkService { get ; } = Ioc . Default . GetRequiredService < INetworkService > ( ) ;
@@ -524,7 +525,7 @@ private static async Task<FilesystemResult> OpenDirectory(string path, IShellPag
524525 {
525526 // Add location to Recent Items List
526527 if ( childFolder . Item is SystemStorageFolder )
527- App . RecentItemsManager . AddToRecentItems ( childFolder . Path ) ;
528+ WindowsRecentItemsService . Add ( childFolder . Path ) ;
528529 } ) ;
529530 if ( ! opened )
530531 opened = ( FilesystemResult ) FolderHelpers . CheckFolderAccessWithWin32 ( path ) ;
@@ -556,7 +557,7 @@ private static async Task<FilesystemResult> OpenFile(string path, IShellPage ass
556557 StorageFileWithPath childFile = await associatedInstance . ShellViewModel . GetFileWithPathFromPathAsync ( shortcutInfo . TargetPath ) ;
557558 // Add location to Recent Items List
558559 if ( childFile ? . Item is SystemStorageFile )
559- App . RecentItemsManager . AddToRecentItems ( childFile . Path ) ;
560+ WindowsRecentItemsService . Add ( childFile . Path ) ;
560561 }
561562 await Win32Helper . InvokeWin32ComponentAsync ( shortcutInfo . TargetPath , associatedInstance , $ "{ args } { shortcutInfo . Arguments } ", shortcutInfo . RunAsAdmin , shortcutInfo . WorkingDirectory ) ;
562563 }
@@ -573,7 +574,7 @@ private static async Task<FilesystemResult> OpenFile(string path, IShellPage ass
573574 {
574575 // Add location to Recent Items List
575576 if ( childFile . Item is SystemStorageFile )
576- App . RecentItemsManager . AddToRecentItems ( childFile . Path ) ;
577+ WindowsRecentItemsService . Add ( childFile . Path ) ;
577578
578579 if ( openViaApplicationPicker )
579580 {
0 commit comments