Skip to content

Commit bcdf1d6

Browse files
authored
Fix crashes in TextBox(es) in Fluent theme (#10841)
* Fix(FluentTheme): Crashes in TB * Propogate changes using theme generator
1 parent 1d5cd94 commit bcdf1d6

File tree

6 files changed

+32
-32
lines changed

6 files changed

+32
-32
lines changed

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/PasswordBox.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" />
8989
</Trigger>
9090
<Trigger Property="IsFocused" Value="True">
91-
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThicknessFocused}" />
91+
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
9292
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
9393
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
9494
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/RichTextBox.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<Setter Property="CaretBrush" Value="{DynamicResource TextControlForeground}" />
2525
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
2626
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" />
27-
<Setter Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThickness}" />
27+
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" />
2828
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
2929
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
3030
<Setter Property="HorizontalContentAlignment" Value="Left" />
@@ -70,7 +70,7 @@
7070
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" />
7171
</Trigger>
7272
<Trigger Property="IsFocused" Value="True">
73-
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThicknessFocused}" />
73+
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
7474
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
7575
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
7676
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/TextBox.xaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<Setter Property="CaretBrush" Value="{DynamicResource TextControlForeground}" />
4040
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
4141
<Setter Property="BorderBrush" Value="{DynamicResource TextControlElevationBorderBrush}" />
42-
<Setter Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThickness}" />
42+
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" />
4343
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
4444
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
4545
<Setter Property="HorizontalContentAlignment" Value="Left" />
@@ -85,7 +85,7 @@
8585
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" />
8686
</Trigger>
8787
<Trigger Property="IsFocused" Value="True">
88-
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThicknessFocused}" />
88+
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
8989
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
9090
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
9191
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />
@@ -205,13 +205,13 @@
205205
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" />
206206
</Trigger>
207207
<Trigger Property="IsFocused" Value="True">
208-
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThicknessFocused}" />
208+
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
209209
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
210210
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
211211
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />
212212
</Trigger>
213213
<Trigger SourceName="DeleteButton" Property="IsPressed" Value="True">
214-
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThicknessFocused}" />
214+
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
215215
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
216216
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
217217
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />
@@ -240,7 +240,7 @@
240240
<Setter Property="CaretBrush" Value="{DynamicResource TextControlForeground}" />
241241
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
242242
<Setter Property="BorderBrush" Value="{DynamicResource TextControlElevationBorderBrush}" />
243-
<Setter Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThickness}" />
243+
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" />
244244
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
245245
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
246246
<Setter Property="HorizontalContentAlignment" Value="Left" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.Dark.xaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3771,7 +3771,7 @@
37713771
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" />
37723772
</Trigger>
37733773
<Trigger Property="IsFocused" Value="True">
3774-
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThicknessFocused}" />
3774+
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
37753775
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
37763776
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
37773777
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />
@@ -4088,7 +4088,7 @@
40884088
<Setter Property="CaretBrush" Value="{DynamicResource TextControlForeground}" />
40894089
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
40904090
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" />
4091-
<Setter Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThickness}" />
4091+
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" />
40924092
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
40934093
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
40944094
<Setter Property="HorizontalContentAlignment" Value="Left" />
@@ -4117,7 +4117,7 @@
41174117
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" />
41184118
</Trigger>
41194119
<Trigger Property="IsFocused" Value="True">
4120-
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThicknessFocused}" />
4120+
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
41214121
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
41224122
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
41234123
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />
@@ -4822,7 +4822,7 @@
48224822
<Setter Property="CaretBrush" Value="{DynamicResource TextControlForeground}" />
48234823
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
48244824
<Setter Property="BorderBrush" Value="{DynamicResource TextControlElevationBorderBrush}" />
4825-
<Setter Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThickness}" />
4825+
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" />
48264826
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
48274827
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
48284828
<Setter Property="HorizontalContentAlignment" Value="Left" />
@@ -4851,7 +4851,7 @@
48514851
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" />
48524852
</Trigger>
48534853
<Trigger Property="IsFocused" Value="True">
4854-
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThicknessFocused}" />
4854+
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
48554855
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
48564856
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
48574857
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />
@@ -4929,13 +4929,13 @@
49294929
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" />
49304930
</Trigger>
49314931
<Trigger Property="IsFocused" Value="True">
4932-
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThicknessFocused}" />
4932+
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
49334933
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
49344934
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
49354935
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />
49364936
</Trigger>
49374937
<Trigger SourceName="DeleteButton" Property="IsPressed" Value="True">
4938-
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThicknessFocused}" />
4938+
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
49394939
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
49404940
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
49414941
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />
@@ -4963,7 +4963,7 @@
49634963
<Setter Property="CaretBrush" Value="{DynamicResource TextControlForeground}" />
49644964
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
49654965
<Setter Property="BorderBrush" Value="{DynamicResource TextControlElevationBorderBrush}" />
4966-
<Setter Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThickness}" />
4966+
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" />
49674967
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
49684968
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
49694969
<Setter Property="HorizontalContentAlignment" Value="Left" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.HC.xaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3684,7 +3684,7 @@
36843684
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" />
36853685
</Trigger>
36863686
<Trigger Property="IsFocused" Value="True">
3687-
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThicknessFocused}" />
3687+
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
36883688
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
36893689
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
36903690
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />
@@ -4001,7 +4001,7 @@
40014001
<Setter Property="CaretBrush" Value="{DynamicResource TextControlForeground}" />
40024002
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
40034003
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" />
4004-
<Setter Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThickness}" />
4004+
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" />
40054005
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
40064006
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
40074007
<Setter Property="HorizontalContentAlignment" Value="Left" />
@@ -4030,7 +4030,7 @@
40304030
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" />
40314031
</Trigger>
40324032
<Trigger Property="IsFocused" Value="True">
4033-
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThicknessFocused}" />
4033+
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
40344034
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
40354035
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
40364036
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />
@@ -4735,7 +4735,7 @@
47354735
<Setter Property="CaretBrush" Value="{DynamicResource TextControlForeground}" />
47364736
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
47374737
<Setter Property="BorderBrush" Value="{DynamicResource TextControlElevationBorderBrush}" />
4738-
<Setter Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThickness}" />
4738+
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" />
47394739
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
47404740
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
47414741
<Setter Property="HorizontalContentAlignment" Value="Left" />
@@ -4764,7 +4764,7 @@
47644764
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" />
47654765
</Trigger>
47664766
<Trigger Property="IsFocused" Value="True">
4767-
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThicknessFocused}" />
4767+
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
47684768
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
47694769
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
47704770
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />
@@ -4842,13 +4842,13 @@
48424842
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" />
48434843
</Trigger>
48444844
<Trigger Property="IsFocused" Value="True">
4845-
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThicknessFocused}" />
4845+
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
48464846
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
48474847
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
48484848
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />
48494849
</Trigger>
48504850
<Trigger SourceName="DeleteButton" Property="IsPressed" Value="True">
4851-
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThicknessFocused}" />
4851+
<Setter TargetName="ContentBorder" Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
48524852
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
48534853
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
48544854
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />
@@ -4876,7 +4876,7 @@
48764876
<Setter Property="CaretBrush" Value="{DynamicResource TextControlForeground}" />
48774877
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
48784878
<Setter Property="BorderBrush" Value="{DynamicResource TextControlElevationBorderBrush}" />
4879-
<Setter Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThickness}" />
4879+
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" />
48804880
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
48814881
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
48824882
<Setter Property="HorizontalContentAlignment" Value="Left" />

0 commit comments

Comments
 (0)