Skip to content

What's the proper way to set Foreground on CheckBox using Lightweight styling? #1214

Discussion options

You must be logged in to vote

Ok so your suggestion of redefining a new SolidColorBrush using a ThemeResource reference on the color is what I ended up doing because it avoids duplicating the overrides per theme.
Thanks for that.

<CheckBox x:Name="TermsOfServiceCheckBox"
	Content="I agree to the terms of services"
	x:Uid="CreateAccount_TermsOfServices"
	IsChecked="{Binding Form.AgreeToTermsOfServices, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
	HorizontalAlignment="Left">
	<CheckBox.Resources>
		<SolidColorBrush x:Key="CheckBoxForegroundUnchecked" Color="{ThemeResource OnPrimaryColor}" />
		<SolidColorBrush x:Key="CheckBoxForegroundUncheckedPointerOver" Color="{ThemeResource OnPrimaryColor}" />
		<SolidColorBrush

Replies: 1 comment 12 replies

Comment options

You must be logged in to vote
12 replies
@Xiaoy312
Comment options

@Xiaoy312
Comment options

@kazo0
Comment options

@jeanplevesque
Comment options

Answer selected by jeanplevesque
@kazo0
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants