Hello,
Welcome to Microsoft Q&A.
If you want the first row’s data template changes after you delete the first row from the collection, the SelectTemplateCore
method in your PeriodDataDataTemplateSelector
class needs to be called to apply the DataTemplate
for the new first row.
When you use ObservableCollection.Move(oldIndex, newIndex)
, it will call the SelectTemplateCore
method automatically, while deleting row will not automatically call the SelectTemplateCore
method automatically.
You could actively call SelectTemplateCore
method after deleting a row, like this:
Contacts.MyContacts.RemoveAt(0);
listView.ItemTemplateSelector = MyDataTemplateSelector;
Or you could just use ObservableColecction.Move()
function instead.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.