I am using RIA services to serve entities to a MVVM-Light enabled Silverlight application.
I have a ViewModel which present a CollectionViewSource of entities to a listbox on the View. The reason I use a CollectionViewSource is so I can control the selected item in the ViewModel; when a new item is created I can create it and then select it for further editing (selecting an item in the listbox enables the editing of that item in a data form).
I need to enable dragdropping for the listbox to allow reordering of the items. I have looked at using the Silverlight Toolkit's ListBoxDragDropTarget to enable this functionality but it doesn't work - I assume this is because I need to set the listbox ItemsSource to an ObservableCollection.
If I change the CollectionViewSource in the ViewModel to an ObservableCollection how can I programmatically change the Selected Item of the listbox from the ViewModel?
Any ideas?