@@ -43,8 +43,18 @@ public YourHome()
4343 App . OneDrivePath = localSettings . Values [ "OneDriveLocation" ] . ToString ( ) ;
4444 }
4545 }
46+ }
4647
47-
48+ private void OpenFileLocation_Click ( object sender , RoutedEventArgs e )
49+ {
50+ var flyoutItem = sender as MenuFlyoutItem ;
51+ var clickedOnItem = flyoutItem . DataContext as RecentItem ;
52+ if ( clickedOnItem . isFile )
53+ {
54+ var filePath = clickedOnItem . path ;
55+ var folderPath = filePath . Substring ( 0 , filePath . Length - clickedOnItem . name . Length ) ;
56+ App . OccupiedInstance . ItemDisplayFrame . Navigate ( typeof ( GenericFileBrowser ) , folderPath ) ;
57+ }
4858 }
4959
5060 protected override void OnNavigatedTo ( NavigationEventArgs eventArgs )
@@ -253,6 +263,7 @@ public async void PopulateRecentsList()
253263 BitmapImage ItemImage = new BitmapImage ( ) ;
254264 string ItemPath = null ;
255265 string ItemName ;
266+ StorageItemTypes ItemType ;
256267 Visibility ItemFolderImgVis ;
257268 Visibility ItemEmptyImgVis ;
258269 Visibility ItemFileIconVis ;
@@ -274,15 +285,17 @@ public async void PopulateRecentsList()
274285 {
275286 ItemName = item . Name ;
276287 ItemPath = item . Path ;
288+ ItemType = StorageItemTypes . Folder ;
277289 ItemFolderImgVis = Visibility . Visible ;
278290 ItemEmptyImgVis = Visibility . Collapsed ;
279291 ItemFileIconVis = Visibility . Collapsed ;
280- recentItemsCollection . Add ( new RecentItem ( ) { name = ItemName , path = ItemPath , EmptyImgVis = ItemEmptyImgVis , FolderImg = ItemFolderImgVis , FileImg = ItemImage , FileIconVis = ItemFileIconVis } ) ;
292+ recentItemsCollection . Add ( new RecentItem ( ) { name = ItemName , path = ItemPath , type = ItemType , EmptyImgVis = ItemEmptyImgVis , FolderImg = ItemFolderImgVis , FileImg = ItemImage , FileIconVis = ItemFileIconVis } ) ;
281293 }
282294 else if ( item . IsOfType ( StorageItemTypes . File ) )
283295 {
284296 ItemName = item . Name ;
285297 ItemPath = item . Path ;
298+ ItemType = StorageItemTypes . File ;
286299 ItemImage = new BitmapImage ( ) ;
287300 StorageFile file = await StorageFile . GetFileFromPathAsync ( ItemPath ) ;
288301 var thumbnail = await file . GetThumbnailAsync ( Windows . Storage . FileProperties . ThumbnailMode . ListView , 30 , Windows . Storage . FileProperties . ThumbnailOptions . ResizeThumbnail ) ;
@@ -297,7 +310,7 @@ public async void PopulateRecentsList()
297310 }
298311 ItemFolderImgVis = Visibility . Collapsed ;
299312 ItemFileIconVis = Visibility . Visible ;
300- recentItemsCollection . Add ( new RecentItem ( ) { path = ItemPath , name = ItemName , FolderImg = ItemFolderImgVis , EmptyImgVis = ItemEmptyImgVis , FileImg = ItemImage , FileIconVis = ItemFileIconVis } ) ;
313+ recentItemsCollection . Add ( new RecentItem ( ) { path = ItemPath , name = ItemName , type = ItemType , FolderImg = ItemFolderImgVis , EmptyImgVis = ItemEmptyImgVis , FileImg = ItemImage , FileIconVis = ItemFileIconVis } ) ;
301314 }
302315 }
303316 catch ( System . IO . FileNotFoundException )
@@ -490,6 +503,8 @@ public class RecentItem
490503 public BitmapImage FileImg { get ; set ; }
491504 public string path { get ; set ; }
492505 public string name { get ; set ; }
506+ public bool isFile { get => type == StorageItemTypes . File ; }
507+ public StorageItemTypes type { get ; set ; }
493508 public Visibility FolderImg { get ; set ; }
494509 public Visibility EmptyImgVis { get ; set ; }
495510 public Visibility FileIconVis { get ; set ; }
0 commit comments