作者:爱在明天2502870673 | 来源:互联网 | 2023-06-23 14:19
IhaveaListViewwiththreeTextBlockforeachItem.Thefirstonehasthedefaultcolor(black)an
I have a ListView with three TextBlock for each Item. The first one has the default color (black) and the others has the property Foreground set to gray.
我有一个列表视图,每个条目有三个文本块。第一个具有默认颜色(黑色),其他的属性前台设置为灰色。
When I select an item the color of the first TextBlock becomes blue but the others stay gray and are hard to read.
当我选择一个条目时,第一个文本块的颜色变为蓝色,而其他文本块则保持灰色,难以阅读。
I want that all the text become white color when the item is selected. How I do that ?
我希望所有的文本在被选中时都变成白色。我该怎么做呢?
Edit : My style :
编辑:我的风格:
My ListView
我的列表视图
I also tried things like
我也尝试过类似的东西
EDIT 2 : I have discovered that the custom style changes the color of Textblock which have the default property as Foreground (black). If I specife Black for the color of the text of the first textblock, the text doesn't change anymore of color when the item is selected.
编辑2:我发现自定义样式改变了Textblock的颜色,它的默认属性为前台(黑色)。如果我指定黑色作为第一个文本块的文本的颜色,那么当该项被选中时,文本不会再改变颜色。
Picture :
图片:
3 个解决方案