This is a bit complicated, so bear with me...
I have a window that contains a ReorderListBox from the WPF Bag of Tricks:
This allows the user to drag a ListBoxItem to move it in the list and reorder the items.
My ReorderListBox.Source is bound to a property called Persons in my Window's ViewModel. Persons is an ObservableCollection<Person>.
My DataTemplate for Person uses a Catel UserControl (called PersonEntry), backed by a ViewModel (PersonEntryViewModel).
The Person class has a Catel property called 'Row'. The intent is that Row should always be identical to the Person's index in the collection. The ViewModel also has a Row property which is mapped to Person.Row via Model and ViewModelToModel
attributes. Pretty standard stuff and it all works, until I drag one item to a different location in the list. Once I do, all of my PersonEntryViewModels seem to disconnect the binding between their Row property and their model's Row property.
If I change the Person.Row value, the PersonEntryViewModel.Row value is not updated. All other properties in the PersonEntryViewModel are still bound to their corresponding Model property.
It may be significant that I have my ReorderListBox setup to only allow dragging an item by clicking and dragging on the TextBlock that is bound to 'Row'.
This is very tough to debug since I am not sure how to determine what is causing the binding to get removed. Is there a way to track this?