I am developing a Windows Phone 8.1 application in C#/XAML.
I have a listview, whose background is set to white. As a result, you can't see the listview items because the foreground of them is also white. I'd like to change that to another color. However, when the item is selected, I'd like to change the foreground color back to white, since when the item gets selected, the background of that item changes color (yellow), allowing white color to be seen by the user.
I have uploaded my code to PasteBin:
MainPage.xaml (the actual page): http://pastebin.com/R9DG9D2J
App.xaml: http://pastebin.com/21qQxHge
In App.xaml, I have overridden the ListViewItemSelectedBackgroundThemeBrush
brush so when an item gets selected, it has a yellow background instead of the default blue one. However, I am unable to change the foreground color of the item. I don't want to hard-code the foreground color in the textblock within the ListViewItem's DataTemplate as if I do that, then the color won't change back to white when the item selected.
How do I go about this?
ObjectAnimation
? – Sean Airey