-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Description
Microsoft Visual Studio Community 2022 - Preview
17.14.11 Preview 1.0
.NET 10 Preview 5
Issue:
When using ResourceDictionary.MergedDictionaries
inside Resources
, and defining styles in a nested dictionary (not from a separate file), the first control in the visual tree (e.g. CheckBox) does not apply the defined style (e.g. FontFamily).

Reproduction Steps
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<Style TargetType="CheckBox">
<Setter Property="FontFamily" Value="Cascadia Code"/>
</Style>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<WindowChrome.WindowChrome>
<WindowChrome NonClientFrameEdges="None"
UseAeroCaptionButtons="False"
CaptionHeight="35"/>
</WindowChrome.WindowChrome>
<Grid Background="#1f1f1f">
<StackPanel Width="320"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<CheckBox IsChecked="True" Content="check 1" Foreground="White" />
<CheckBox IsChecked="True" Content="check 2" Foreground="White" />
<CheckBox IsChecked="True" Content="check 3" Foreground="White" />
</StackPanel>
</Grid>
Expected behavior
All CheckBoxes should use Cascadia Code.
Actual behavior
First CheckBox uses Segoe UI, others use Cascadia Code.
Regression?
No response
Known Workarounds
No response
Impact
No response
Configuration
No response
Other information
No response
Metadata
Metadata
Assignees
Labels
No labels