@@ -15,6 +15,7 @@ namespace Files.App.Helpers
1515{
1616 public static class NavigationHelpers
1717 {
18+ private static readonly IWindowsRecentItemsService WindowsRecentItemsService = Ioc . Default . GetRequiredService < IWindowsRecentItemsService > ( ) ;
1819 private static MainPageViewModel MainPageViewModel { get ; } = Ioc . Default . GetRequiredService < MainPageViewModel > ( ) ;
1920 private static DrivesViewModel DrivesViewModel { get ; } = Ioc . Default . GetRequiredService < DrivesViewModel > ( ) ;
2021 private static INetworkService NetworkService { get ; } = Ioc . Default . GetRequiredService < INetworkService > ( ) ;
@@ -527,7 +528,7 @@ private static async Task<FilesystemResult> OpenDirectory(string path, IShellPag
527528 {
528529 // Add location to Recent Items List
529530 if ( childFolder . Item is SystemStorageFolder )
530- App . RecentItemsManager . AddToRecentItems ( childFolder . Path ) ;
531+ WindowsRecentItemsService . Add ( childFolder . Path ) ;
531532 } ) ;
532533 if ( ! opened )
533534 opened = ( FilesystemResult ) FolderHelpers . CheckFolderAccessWithWin32 ( path ) ;
@@ -559,7 +560,7 @@ private static async Task<FilesystemResult> OpenFile(string path, IShellPage ass
559560 StorageFileWithPath childFile = await associatedInstance . ShellViewModel . GetFileWithPathFromPathAsync ( shortcutInfo . TargetPath ) ;
560561 // Add location to Recent Items List
561562 if ( childFile ? . Item is SystemStorageFile )
562- App . RecentItemsManager . AddToRecentItems ( childFile . Path ) ;
563+ WindowsRecentItemsService . Add ( childFile . Path ) ;
563564 }
564565 await Win32Helper . InvokeWin32ComponentAsync ( shortcutInfo . TargetPath , associatedInstance , $ "{ args } { shortcutInfo . Arguments } ", shortcutInfo . RunAsAdmin , shortcutInfo . WorkingDirectory ) ;
565566 }
@@ -576,7 +577,7 @@ private static async Task<FilesystemResult> OpenFile(string path, IShellPage ass
576577 {
577578 // Add location to Recent Items List
578579 if ( childFile . Item is SystemStorageFile )
579- App . RecentItemsManager . AddToRecentItems ( childFile . Path ) ;
580+ WindowsRecentItemsService . Add ( childFile . Path ) ;
580581
581582 if ( openViaApplicationPicker )
582583 {
0 commit comments