Binding the IsSelected property of ListBoxItem to a property on the object from it's source

后端 未结 2 1877
离开以前
离开以前 2020-12-17 09:19

I have a WPF ListBox control and I\'m setting its ItemsSource to a collection of item objects. How can I bind the IsSelected property

2条回答
  •  天命终不由人
    2020-12-17 10:13

    Just override ItemContainerStyle:

       
         
          
         
        
    

    Oh, by the way, I think you'd like this wonderful articles from dr.WPF: ItemsControl: A to Z.

    Hope this helps.

提交回复
热议问题