You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When using an ItemsRepeater control, the displayed items become out of sync with the items source after the items source is sorted. Display order is not respected, and other weird things can happen as well, including repeated visual elements which are not duplicated in the items source.
To Reproduce
The problem has persisted for me under a variety of circumstances. I have tried the following to fix the problem:
Scenario 1: When using ObservableCollection, I sort the items source using only the Move() method.
Scenario 2: When using ObservableCollection, I sort the items source in a temporary copy, then Clear() the items source and Add() from the sorted copy.
Scenario 3: When using a OneWay binding from the items source to ItemsRepeater.Items, I sort the items source in a temporary copy, destroy the original, assign the sorted copy to the items source, and then raise a PropertyChanged event.
CURRENT WORKAROUND: When a sort is completed, I destroy the previous ItemsRepeater and create a new one with the sorted items.
Expected behavior
The displayed items should match the source items, in both number and order, at all times.
Desktop
OS: Windows 10 Enterprise
Version: 10.0.19043 Build 19043
Additional context
This is my first project with Avalonia, so please tell me if you think I am doing something incorrectly.
The text was updated successfully, but these errors were encountered:
Description
When using an ItemsRepeater control, the displayed items become out of sync with the items source after the items source is sorted. Display order is not respected, and other weird things can happen as well, including repeated visual elements which are not duplicated in the items source.
To Reproduce
The problem has persisted for me under a variety of circumstances. I have tried the following to fix the problem:
Scenario 1: When using ObservableCollection, I sort the items source using only the Move() method.
Scenario 2: When using ObservableCollection, I sort the items source in a temporary copy, then Clear() the items source and Add() from the sorted copy.
Scenario 3: When using a OneWay binding from the items source to ItemsRepeater.Items, I sort the items source in a temporary copy, destroy the original, assign the sorted copy to the items source, and then raise a PropertyChanged event.
CURRENT WORKAROUND: When a sort is completed, I destroy the previous ItemsRepeater and create a new one with the sorted items.
Expected behavior
The displayed items should match the source items, in both number and order, at all times.
Desktop
Additional context
This is my first project with Avalonia, so please tell me if you think I am doing something incorrectly.
The text was updated successfully, but these errors were encountered: