I'm using MVVM Light on an SL4 app. I would like to set the selected items on a listbox after it is databound.
I have no problem when there is one item to set, but I do not know how do do this when I have to set multiple it开发者_Python百科ems in the list.
Bind the IsSelected property of the ItemContainerStyle to a bool property on the view models that are bound to ItemsSource.
You can then just set that property to true or false to select or deselect the item in the listbox.
精彩评论