创建一个属性:
public bool IsSelected { get; set; }
Xaml:
<ListBox.ItemContainerStyle> <Style TargetType="{x:Type ListBoxItem}"> <Setter Property="IsSelected" Value="{Binding Mode=TwoWay, Path=IsSelected}"/> </Style> </ListBox.ItemContainerStyle>
感谢您的回答,我暂时没有办法看懂,谢谢你。另外找到类似文献一篇,共享给你。http://www.silverlightchina.net/html/study/WPF/2011/1108/11596.html