Skip to content

Button unwantedly changes color #19525

Answered by ajpinedam
Omega596 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Omega596 , you can change this behavior by overriding the style of your controls using Lightweight Styling.

In summary, Lightweight Styling allows you to customize the appearance of XAML controls by overriding their default brushes, fonts, and numeric properties.

So, for example, if you want to customize the way a button looks when hovering (Point Over), you'll be able to do it with the following code:

<Button Content="Overridden Button Style (PointerOver)"
        Style="{StaticResource FilledButtonStyle}">
    <Button.Resources>
        <Thickness x:Key="ButtonBorderThickness">2</Thickness>
        <SolidColorBrush x:Key="FilledButtonForegroundPointerOver" Color="DarkRed" />
        <

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Omega596
Comment options

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