With the Q1 2015 release version of UI for Silverlight, the ability to manipulate the SelectedItems collection of RadListBox through the ViewModel is now available. This is now possible with the brand new ListBoxSelectedItemsBehavior behavior and its SelectedItemsSource attached property. The SelectedItemsSource is a collection that synchronizes itself with the SelectedItems collection of RadListBox – thus if an item is added, removed or the collection is replaced/cleared those actions will be executed on the SelectedItems collection as well.
The following example will demonstrate how to bind the SelectedItemsSource property of the ListBoxSelectedItemsBehavior to a collection of custom objects. In order the synchronization between the SelectedItemSource and the SelectedItems of RadListBox control to be possible the bound collection should implement both the IEnumerable and the INotifyCollectionChanged interfaces.
Synchronization won’t be possible if SelectedItemsSource is bound to a collection that does not implement INotifyCollectionChanged.
The SelectedItemsSource and the ItemsSource should be bound to collections of the same type of items.
You can download a runnable project of the previous example from our online SDK repository here, the example is listed as RadListBox/SelectedItemsSource.