Winui3 Button color?

Ward Horsfall 101 Reputation points
2022-06-23T20:36:48.897+00:00

Hi

Hi got a question on button color - now this is coming from a WPF point of view.

It looks like the default buttons are not grey like the are in WPF.

First question is I am assuming it is some guideline that I am not understanding.

Plus is there some documentation to point me to as to be honest it does not contrast as well to WPF defaults. In respect to the button background and the surface (Window) it might appear on.

Thanks
Ward

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
743 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 82,661 Reputation points
    2022-06-23T21:39:02.863+00:00

    All colors are defined in generic.xaml

    For button, you can see

     <StaticResource x:Key="ButtonBackground" ResourceKey="ControlFillColorDefaultBrush" />  
     <StaticResource x:Key="ButtonBackgroundPointerOver" ResourceKey="SystemColorHighlightTextColorBrush" />  
     // etc...  
    

    then

     <SolidColorBrush x:Key="ControlFillColorDefaultBrush" Color="{StaticResource ControlFillColorDefault}" />  
    

    then

     <Color x:Key="ControlFillColorDefault">#0FFFFFFF</Color>  
    

    So they are partially transparent, depending on the parent background color
    an can be changed in XAML in ResourceDictionary.ThemeDictionaries for example

    1 person found this answer helpful.
    0 comments No comments

  2. Michael Taylor 50,506 Reputation points
    2022-06-23T20:46:45.43+00:00

    The design guidelines that WinUI3 follows is documented here. As always, if you don't like the defaults then you can customize to use your own theme. The defaults are discussed here.

    0 comments No comments