Hello,
Based on the solution of the following ticket:
https://www.devexpress.com/Support/Center/Question/Details/T190614
I tried to create an MVVM approach of the recommended solution. The problem I am having is that when you remove all the items from the ObservableCollection that the TileLayoutControl.ItemsSource bound with and then you start adding new items (with drag and drop) you have a mismatch with the order of the items in the TileLayoutControl and the ObservableCollection.
The scenario to reproduce the problem, in the sample project, is the following:
- At the initial state of the program you can add new items from the ListBox at the left edge of the window with drag and drop or you can rearrange the existing items in the TileLayoutControl. When you click at the "Print Collection" button a message box with the order of the collection will appear. As you will see the order of the collection and the order of the Tiles in the TileLayoutControl is the same.
- Remove all the items from the TileLayoutControl by clicking the "Remove All Tiles"
- Start adding new items with drag and drop
- If you click now the "Print Collection" button you will notice a mismatch in the order of the items in the ObservableCollection of the ViewModel and in the items of the TileLayoutVControl.
Is there a way or can you suggest a solution to avoid this problem.
Thanks in advance