地铁应用更改ListView中选定的项目内容前景 [英] Metro App Change ListView Selected Item Content Foreground

查看:177
本文介绍了地铁应用更改ListView中选定的项目内容前景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个的ListView 并修改它的的DataTemplate 与2 的TextBlocks

I have a ListView and modified it's DataTemplate with 2 TextBlocks.

第一个的TextBlock 包含的标题,第二个子标题

The first TextBlock contains a Heading, the second a Sub-Heading.

我的风格2 的TextBlocks 用不同的颜色。

I style the 2 TextBlocks with different colours.

下面是一个例子 ListViewItem的中的常规查看

Here's an example of the ListViewItem in Normal view.

下面是一个例子 ListViewItem的中的选择查看

Here's an example of the ListViewItem in Selected view.

所以我的问题是我怎么改变的的TextBlocks 前景颜色的意见?希望能够做到这一点在XAML。我试过设置不同的画笔,这对于尚未明确被称呼的项目工作。

So my question is how do I change the Foreground colours of the TextBlocks in Selected views? Hoping to do this in the xaml. I've tried setting different brushes, which work for items that haven't explicitly been styled.

不知道如何处理这种情况。

Not sure how to handle this scenario.

推荐答案

由于一些研究和思考的开箱,发现工作的合适的解决方案:

Thanks to some researching and thinking out of the box, found a suitable solution that works:

<一个href=\"http://stackoverflow.com/questions/17010582/metro-app-listview-selecteditem-selected-visualstate\">Metro应用程序的ListView的SelectedItem选择的VisualState

我可以看到这个了几个其他场景是方便为好。

I can see this being handy for a couple of other scenarios as well.

这篇关于地铁应用更改ListView中选定的项目内容前景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆