开发者

How Do I Change WPF Listview SelectedItem Font Color With ItemSource Bound?

开发者 https://www.devze.com 2023-03-23 05:54 出处:网络
I have WPF window containing a listview that has it\'s itemsource set to a collection of objects. When I access SelectedItem or SelectedItems[] or Items[], I get the my object back that\'s bound to th

I have WPF window containing a listview that has it's itemsource set to a collection of objects. When I access SelectedItem or SelectedItems[] or Items[], I get the my object back that's bound to that item, not the ListViewItem item 开发者_Go百科itself. I have no idea how to select a row and change it's color since I can't access the item itself, like a winform listviewitem.


ListView derives from ItemsControl which exposes the ItemContainerGenerator property. This object allows you to map a bound entity to its ItemContainer (the item your are looking for) and back.

0

精彩评论

暂无评论...
验证码 换一张
取 消