Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试执行以下操作。我有一个带有绑定到对象列表的 DataTemplate 的 listBox。
我还有另一个绑定到对象的元素。该对象包含一个属性,该属性是对列表框中元素之一的引用。
ListBox 的 DataTemplate 有一个边框,我想在另一个对象引用的列表项周围制作一个额外的粗边框。
我一直在玩触发器等,但我似乎无法弄清楚如何解决这个问题。
有什么建议么?
查看DataTemplateSelector。您可以根据绑定对象的属性选择要使用的数据模板。