

See the line SelectedBackground=""? That's where you can apply your own color to it.
UWP SELECTED TEXT COLOR CODE
You should be look at this piece of code.
UWP SELECTED TEXT COLOR FULL
Now, you have generated the full built-in style for your ListViewItems and this is where you can find all the information about their appearance, animations and other visual behaviors. Then right click on your ListView and goĮdit Additional Templates > Edit Generated Item Container (ItemContainerStyle) > Edit a Copy. Hosting the logic in the Navigation Service instead of in the Page also allows to set back the default color when the user navigates away from the page.Actually a better way to discover the styling properties is to use Blend.įirst, open up your page in Blend. So I added an new empty page to the solution, moved call to switch the accent color out of the Page and into the Navigation Service, and added an extra visit to the new empty page to the navigation logic. Whilst thoroughly testing the app I noticed that this phenomenon never occurred when navigating from one of the empty pages (Settings and About). Sometimes you’re served with a control from this cache and you’ll end up with a recycled UI element that still uses a previous accent color, like this: Apparently UWP creates a cache of the most common control types. But even there it is already too late for some controls. The call even be done before InitializeComponent (which is actually a weird place to write code). You have to do this before any control starts to render, so preferably in the constructor. The method can be called from a page’s code.

If not, the new accent color is simply ignored. To change the accent color from C#, it suffices to override the SystemAccentColor in the Resources of the current application.
UWP SELECTED TEXT COLOR WINDOWS 10
This will impact the following default brushes (the list depends on your Windows 10 version), in order of appearance in generic.xaml: In your app.xaml, add a ThemeDictionary and override the SystemAccentColor for each theme (Default, Dark, and Light):
Go to Line 76 in App.xaml to find the VisualStateGroup named SelectedState and it's two VisualStates Selected and Unselected. Let’s start with explaining the correct way to statically override the system accent color. 4b - Now, for the crucial part, we need to edit the Selected VisualStates so that we apply that background color only when the item is selected. As you see, every page has its own accent color applied to all controls: Here’s a screen capture from the sample app, which is derived from my SplitView Navigation project. Wouldn’t it be nice to give all the pages on Water blue controls, and all pages on Fire red controls without creating different style for each control and each theme color? Let’s say you’re building an app around the elements of nature. This article shows how this accent color can be overridden when navigating to or from individual pages, so that each page can have its own theme. Therefor, a lot of apps statically override this accent color. When a UWP app is running, this color is applied to lot of controls (checkbox, slider, focused text box) and hence this color could possibly collide with the app’s own theme colors. By default, the system accent color is the Windows theme color chosen by end user. This article describes an algorithm that allows individual pages in a XAML UWP app to override the system accent color.
