-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Currently, if the user sets Foreground at the root of the XAML:
`
<Grid Background="{DynamicResource Theme_BackgroundBrush}">
<TextBlock Text="Hello, World!" FontSize="23" Margin="32,32,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
<Button Content="Button" Margin="32,80,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="88" Height="32" />
<RadioButton Content="RadioButton" Margin="32,128,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" Height="32" />
<CheckBox Content="Checkbox" Margin="32,176,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" Height="32" />
</Grid>
`
it won't affect the text color of Button, RadioButton, CheckBox etc:
This is due to the fact that, in the modern theme, we set Foreground, FontSize, etc. in a style, like this:
<Setter Property="Foreground" Value="{DynamicResource Theme_TextBrush}" />
and the style takes precendence on inherited values.
To solve this problem, I propose that we remove such style setters and, instead, we implement a system that, when a theme is applied, automatically sets Foreground, FontSize, etc. to the RootVisual, so that the property is inherited to the full visual tree, and developers can easily override those properties on a subtree.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request