@@ -43,8 +43,18 @@ public YourHome()
43
43
App . OneDrivePath = localSettings . Values [ "OneDriveLocation" ] . ToString ( ) ;
44
44
}
45
45
}
46
+ }
46
47
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
+ }
48
58
}
49
59
50
60
protected override void OnNavigatedTo ( NavigationEventArgs eventArgs )
@@ -253,6 +263,7 @@ public async void PopulateRecentsList()
253
263
BitmapImage ItemImage = new BitmapImage ( ) ;
254
264
string ItemPath = null ;
255
265
string ItemName ;
266
+ StorageItemTypes ItemType ;
256
267
Visibility ItemFolderImgVis ;
257
268
Visibility ItemEmptyImgVis ;
258
269
Visibility ItemFileIconVis ;
@@ -274,15 +285,17 @@ public async void PopulateRecentsList()
274
285
{
275
286
ItemName = item . Name ;
276
287
ItemPath = item . Path ;
288
+ ItemType = StorageItemTypes . Folder ;
277
289
ItemFolderImgVis = Visibility . Visible ;
278
290
ItemEmptyImgVis = Visibility . Collapsed ;
279
291
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 } ) ;
281
293
}
282
294
else if ( item . IsOfType ( StorageItemTypes . File ) )
283
295
{
284
296
ItemName = item . Name ;
285
297
ItemPath = item . Path ;
298
+ ItemType = StorageItemTypes . File ;
286
299
ItemImage = new BitmapImage ( ) ;
287
300
StorageFile file = await StorageFile . GetFileFromPathAsync ( ItemPath ) ;
288
301
var thumbnail = await file . GetThumbnailAsync ( Windows . Storage . FileProperties . ThumbnailMode . ListView , 30 , Windows . Storage . FileProperties . ThumbnailOptions . ResizeThumbnail ) ;
@@ -297,7 +310,7 @@ public async void PopulateRecentsList()
297
310
}
298
311
ItemFolderImgVis = Visibility . Collapsed ;
299
312
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 } ) ;
301
314
}
302
315
}
303
316
catch ( System . IO . FileNotFoundException )
@@ -490,6 +503,8 @@ public class RecentItem
490
503
public BitmapImage FileImg { get ; set ; }
491
504
public string path { get ; set ; }
492
505
public string name { get ; set ; }
506
+ public bool isFile { get => type == StorageItemTypes . File ; }
507
+ public StorageItemTypes type { get ; set ; }
493
508
public Visibility FolderImg { get ; set ; }
494
509
public Visibility EmptyImgVis { get ; set ; }
495
510
public Visibility FileIconVis { get ; set ; }
0 commit comments