@@ -295,16 +295,39 @@ private async void BreadcrumbBar_ItemDropDownFlyoutOpening(object sender, Breadc
295
295
if ( storable is not IWindowsStorable windowsStorable )
296
296
continue ;
297
297
298
- e . Flyout . Items . Add ( new MenuFlyoutItem ( ) { Text = windowsStorable . GetDisplayName ( Windows . Win32 . UI . Shell . SIGDN . SIGDN_PARENTRELATIVEFORUI ) } ) ;
298
+ var flyoutItem = new MenuFlyoutItem ( )
299
+ {
300
+ Text = windowsStorable . GetDisplayName ( Windows . Win32 . UI . Shell . SIGDN . SIGDN_PARENTRELATIVEFORUI ) ,
301
+ Icon = new FontIcon { Glyph = "\uE8B7 " } , // Use font icon as placeholder
302
+ } ;
303
+
304
+ e . Flyout . Items . Add ( flyoutItem ) ;
305
+
306
+ windowsStorable . TryGetThumbnail ( ( int ) ( 16f * App . AppModel . AppWindowDPI ) , Windows . Win32 . UI . Shell . SIIGBF . SIIGBF_ICONONLY , out var thumbnailData ) ;
307
+ flyoutItem . Icon = new ImageIcon ( ) { Source = await MainWindow . Instance . DispatcherQueue . EnqueueOrInvokeAsync ( ( ) => thumbnailData . ToBitmapAsync ( ) , Microsoft . UI . Dispatching . DispatcherQueuePriority . Normal ) } ;
308
+
299
309
windowsStorable . Dispose ( ) ;
300
310
}
301
311
302
312
e . Flyout . Items . Add ( new MenuFlyoutHeaderItem ( ) { Text = "Drives" } ) ;
303
313
304
- await foreach ( IWindowsStorable storable in homeFolder . GetLogicalDrivesAsync ( ) )
314
+ await foreach ( var storable in homeFolder . GetLogicalDrivesAsync ( ) )
305
315
{
306
- e . Flyout . Items . Add ( new MenuFlyoutItem ( ) { Text = storable . GetDisplayName ( Windows . Win32 . UI . Shell . SIGDN . SIGDN_PARENTRELATIVEFORUI ) } ) ;
307
- storable . Dispose ( ) ;
316
+ if ( storable is not IWindowsStorable windowsStorable )
317
+ continue ;
318
+
319
+ var flyoutItem = new MenuFlyoutItem ( )
320
+ {
321
+ Text = windowsStorable . GetDisplayName ( Windows . Win32 . UI . Shell . SIGDN . SIGDN_PARENTRELATIVEFORUI ) ,
322
+ Icon = new FontIcon { Glyph = "\uE8B7 " } , // Use font icon as placeholder
323
+ } ;
324
+
325
+ e . Flyout . Items . Add ( flyoutItem ) ;
326
+
327
+ windowsStorable . TryGetThumbnail ( ( int ) ( 16f * App . AppModel . AppWindowDPI ) , Windows . Win32 . UI . Shell . SIIGBF . SIIGBF_ICONONLY , out var thumbnailData ) ;
328
+ flyoutItem . Icon = new ImageIcon ( ) { Source = await MainWindow . Instance . DispatcherQueue . EnqueueOrInvokeAsync ( ( ) => thumbnailData . ToBitmapAsync ( ) , Microsoft . UI . Dispatching . DispatcherQueuePriority . Normal ) } ;
329
+
330
+ windowsStorable . Dispose ( ) ;
308
331
}
309
332
310
333
return ;
0 commit comments