@@ -208,6 +208,11 @@ private void InitializeTemplates() {
208208 VerticalAlignment=""Center""/>
209209 </ItemsPanelTemplate>" ) ;
210210
211+ // Label templates will be created dynamically in CreateLabelTemplates() with the actual font size
212+ }
213+
214+ // Create label templates with the specified font size
215+ private void CreateLabelTemplates ( int fontSize ) {
211216 // Create item template with labels
212217 const int EFFECTIVE_BUTTON_WIDTH_WITH_LABEL = BUTTON_SIZE_WITH_LABEL + ( BUTTON_MARGIN * 2 ) ;
213218 _itemTemplateWithLabel = ( DataTemplate ) XamlReader . Load (
@@ -225,7 +230,7 @@ private void InitializeTemplates() {
225230 HorizontalAlignment=""Center""
226231 Margin=""4,6,4,2"" />
227232 <TextBlock Text=""{{Binding ToolTip}}""
228- FontSize=""{ DEFAULT_LABEL_SIZE } ""
233+ FontSize=""{ fontSize } ""
229234 TextTrimming=""CharacterEllipsis""
230235 TextAlignment=""Center""
231236 HorizontalAlignment=""Center""
@@ -263,7 +268,7 @@ private void InitializeTemplates() {
263268 VerticalAlignment=""Center""
264269 Margin=""0,0,8,0"" />
265270 <TextBlock Text=""{{Binding ToolTip}}""
266- FontSize=""{ DEFAULT_LABEL_SIZE } ""
271+ FontSize=""{ fontSize } ""
267272 TextTrimming=""CharacterEllipsis""
268273 VerticalAlignment=""Center""
269274 MaxWidth=""{ BUTTON_WIDTH_HORIZONTAL_LABEL - ICON_SIZE - 12 } ""
@@ -345,6 +350,11 @@ private void InitializeWindow() {
345350 _labelSize = filteredGroup . Value . LabelSize > 0 ? filteredGroup . Value . LabelSize : DEFAULT_LABEL_SIZE ;
346351 _currentColumns = maxColumns ;
347352
353+ // Create label templates with the actual font size from config
354+ if ( _showLabels ) {
355+ CreateLabelTemplates ( _labelSize ) ;
356+ }
357+
348358 if ( ! int . TryParse ( filteredGroup . Key , out _groupId ) ) {
349359 Debug . WriteLine ( $ "Error: Group key '{ filteredGroup . Key } ' is not a valid integer ID") ;
350360 return ;
0 commit comments