Overriding Accent Color in UWP App

August 6, 2016 • 2 min read

Create & Run a UWP Xaml App and the UI will adhere to User’s theme and color preferences. The App will show up with Light or Dark theme with all controls using the Accent Color for their Visual States.

You can specify Requested Theme in App.xaml to override the system theme and set it to Light or Dark:

RequestedTheme=”Light”

Here’s another little trick that lets you override the system Accent Color. Add a Color resource with key ‘SystemAccentColor’ to App.xaml’s Resources with hex code value of the color you want to set:

<Application.Resources>
    <Color x:Key=”SystemAccentColor”>#548dd4</Color>
    …
</Application.Resources>

Now, all default Xaml controls will use this color for highlights, selection, and other visual states. With these two simple lines of code, you can create a color branding for your App.

I hope this Mini article helps you in your App development. Happy coding!

P.S.
I’m going to try to write blog posts once or twice a month, so come back for more stuff like this!

Blog, RSS Feed