@@ -50,6 +50,20 @@ public int RowHeight
5050 get => LayoutSizeKindHelper . GetColumnsViewRowHeight ( UserSettingsService . LayoutSettingsService . ColumnsViewSize ) ;
5151 }
5252
53+ /// <summary>
54+ /// Icon Box size layout. The value is increased by 4px to account for icon overlays.
55+ /// </summary>
56+ public int IconBoxSize
57+ {
58+ get => ( int ) ( LayoutSizeKindHelper . GetIconSize ( FolderLayoutModes . ColumnView ) + 4 ) ;
59+ }
60+
61+ /// <summary>
62+ /// This reference is used to prevent unnecessary icon reloading by only reloading icons when their
63+ /// size changes, even if the layout size changes (since some layout sizes share the same icon size).
64+ /// </summary>
65+ private uint currentIconSize ;
66+
5367 // Constructor
5468
5569 public ColumnLayoutPage ( ) : base ( )
@@ -149,6 +163,8 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
149163
150164 base . OnNavigatedTo ( eventArgs ) ;
151165
166+ currentIconSize = LayoutSizeKindHelper . GetIconSize ( FolderLayoutModes . ColumnView ) ;
167+
152168 UserSettingsService . LayoutSettingsService . PropertyChanged += LayoutSettingsService_PropertyChanged ;
153169
154170 SetItemContainerStyle ( ) ;
@@ -180,12 +196,36 @@ private void LayoutSettingsService_PropertyChanged(object? sender, PropertyChang
180196 var previousOffset = ContentScroller ? . VerticalOffset ;
181197
182198 NotifyPropertyChanged ( nameof ( RowHeight ) ) ;
199+ NotifyPropertyChanged ( nameof ( IconBoxSize ) ) ;
183200
184201 // Update the container style to match the item size
185202 SetItemContainerStyle ( ) ;
186203
187204 // Restore correct scroll position
188205 ContentScroller ? . ChangeView ( null , previousOffset , null ) ;
206+
207+ // Check if icons need to be reloaded
208+ var newIconSize = LayoutSizeKindHelper . GetIconSize ( FolderLayoutModes . ColumnView ) ;
209+ if ( newIconSize != currentIconSize )
210+ {
211+ currentIconSize = newIconSize ;
212+ _ = ReloadItemIconsAsync ( ) ;
213+ }
214+ }
215+ }
216+
217+ private async Task ReloadItemIconsAsync ( )
218+ {
219+ if ( ParentShellPageInstance is null )
220+ return ;
221+
222+ ParentShellPageInstance . ShellViewModel . CancelExtendedPropertiesLoading ( ) ;
223+ var filesAndFolders = ParentShellPageInstance . ShellViewModel . FilesAndFolders . ToList ( ) ;
224+ foreach ( ListedItem listedItem in filesAndFolders )
225+ {
226+ listedItem . ItemPropertiesInitialized = false ;
227+ if ( FileList . ContainerFromItem ( listedItem ) is not null )
228+ await ParentShellPageInstance . ShellViewModel . LoadExtendedItemPropertiesAsync ( listedItem ) ;
189229 }
190230 }
191231
0 commit comments