I have tried for about half an hour myself through both Expression Blend 5 Beta and Visual Studio 11 Beta but cannot figure out what should be a fairly trivial task on how to apply a different background colour when you click on a ListView
item over the standard navy green with the tick which appears to ship standard on WinRT apps with Windows 8 Consumer Preview.
I believe I would need a <VisualStateManager/>
declaration inside my XAML inside the <DataTemplate/>
of my ListView (the same as what I did on a Button
control), but cannot work out a way to get the "States" tab functioning in Blend to start recording these actions, and furthermore I am not sure what name to call the VisualState
after I eventually work out how to do this.
For instance, customising the Pressed
visual state for a Button
was fairly easy after I right clicked and edited it's control template I could then access the "States" tab in Blend and start recording my Pressed, Disabled, PointerOver actions etc, but doesn't seem to be that easy with ListView's or possibly other controls?
Due to both Blend 5 and VS 11 being Beta, it makes it difficult to know what could just be an uncoded feature in the UI of Blend, or simply me doing things wrong! So I appreciate any help anyone could provide. Thanks
The selection state should be part of the ItemContainerStyle - either in form of a visual state or a trigger, but ItemContainerStyle does not seem to be exposed in the designer view, so it is hard to modify it, but you can just add a ListViewItem to your XAML and the designer will happily tell you what its style and template is so you can change it.
You can modify the style in your GridView or ListView by setting
And adding these resources to an active resource dictionary (eg. Page.Resources):