Alex Rivera | Logout

Sync SelectedItems in a muliselect listbox with a collection in ViewModel

Asked 2009-08-19T03:05:29.727
20

I have a multi-select listbox in a SL3 app using prism and I need a collection in my viewmodel that contains the currently selected items in the listbox.

The viewmodel doesn't know anything about the view so it does not have access to the listbox control. Also I need to be able to clear the selected items in the listbox from the viewmodel.

Not sure how to approach this problem

thanks Michael

Edit
Report

1 Answer

0

For those who still could not make candritzky answer to work, make sure you didn't modify your Windows theme colors like me. It turns out my ListBox background color was matching the selection color when the ListBox was out of focus, thus making it appear like nothing was selected.

Change your ListBox background brush to red to check if this is what's happening to you. It made me spend 2 hours until I realized...

answered 2013-03-09T03:03:50.633

Your Answer