@@ -295,16 +295,39 @@ private async void BreadcrumbBar_ItemDropDownFlyoutOpening(object sender, Breadc
295295 if ( storable is not IWindowsStorable windowsStorable )
296296 continue ;
297297
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+
299309 windowsStorable . Dispose ( ) ;
300310 }
301311
302312 e . Flyout . Items . Add ( new MenuFlyoutHeaderItem ( ) { Text = "Drives" } ) ;
303313
304- await foreach ( IWindowsStorable storable in homeFolder . GetLogicalDrivesAsync ( ) )
314+ await foreach ( var storable in homeFolder . GetLogicalDrivesAsync ( ) )
305315 {
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 ( ) ;
308331 }
309332
310333 return ;
0 commit comments