开发者

How to set multiple items on LISTBOX MVVM LIGHT

开发者 https://www.devze.com 2023-04-06 08:59 出处:网络
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'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.

0

精彩评论

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

关注公众号