Iris Classon
Iris Classon - In Love with Code

Example Metro app /WinRT: How to change default selected item colors when using Listview?

I am not overly fond of the default selected item color which is a dark purple (noting wrong with the color, it is just hard to make it work with otehr colors as it is so ‘strong’ and unusual). I wrote a blog post showing how to edit default templates Example WinRT/Metro App: How to edit default template in Visual Studio 2012 and Blend , but maybe you just want to edit the selected item color- and set the new color as default. You could remove the x:Key and then the massice template with few changes would override the default. I would like to show you how to ONLY change the selection color by defining the color of the four brushes involved. Sorry about the ugly color-combo,- it’s just to make it clear which brush is used when :)

The brush that is green indicates selected item for a few milliseconds

After the item is selected it turns to the yellow brush from green (and black border)

Here is the code I’ve used, change the brushes as you like and add these brushes as a resource

[sourcecode language=“XML”]

// After selection - Background

// When pointer hovers over an item - Background

// When the item is selected (first few milliseconds) - Background

// When the item is selected (first few milliseconds) - Border

[/sourcecode]

Comments

Leave a comment below, or by email.
daniel
9/23/2012 11:49:34 AM
Thanks Works great :) 
win8
9/25/2012 8:09:40 AM
I found it! Yahoo! 
David Overton
2/8/2013 5:49:15 AM
Is there a way to make the border disappear?

I want to create a treeview similar to the one in the Official Mail App for the folder listings.  Each item, when selected does not have any visible border.

Thanks

David 


Last modified on 2012-07-27

comments powered by Disqus