Describe the bug
After setting the sorting rules using the DataSGrid Collections View, when the data changes and is reordered for display, there is a flashing screen issue when the mouse hovers over the DataGrid,

The source code is as follows:
.xaml
<DataGrid ItemsSource="{Binding PriceDataView}" >
<DataGrid.Styles>
<Style Selector="DataGridCell TextBlock#CellTextBlock">
<Setter Property="ToolTip.Tip" Value="{Binding $self.Text}" />
</Style>
</DataGrid.Styles>
<DataGrid.Columns>
<DataGridTextColumn Header="Content" Binding="{ReflectionBinding Content}" />
</DataGrid.Columns>
</DataGrid>
.cs
List<PriceData> Data{ get; } = [];
public DataGridCollectionView PriceDataView{ get; private set; }
var dgsdAscContent = DataGridSortDescription.FromPath("Content", ListSortDirection.Ascending);
PriceDataView = new DataGridCollectionView(Data);
PriceDataView.SortDescriptions.Add(dgsdDescContent);
// Simulate data here at regular intervals
var list = Enumerable.Range(0, Random.Shared.Next(10, 20)).Select(x => new PriceData { Index = x, Content = Random.Shared.Next() }).ToList();
var data = Data.ToList();
var indexs = listn.Select(x => x.Index).ToList();
for (int i = data.Count - 1; i >= 0; i--)
{
if (!indexs.Contains(data[i].Index))
{
Data.Remove(data[i]);
}
}
indexs.Clear();
indexs=null;
foreach (var item in data) {
var model = data.FirstOrDefault(x => x.Index == item.Index );
if (model == null)
{
Data.Add(new PriceData { Index= item.Index, Content = item.Content });
}
else
{
model.Content = item.Content;
}
}
Dispatcher.UIThread.Invoke(PriceDataView.Refresh);
data = null;
Expected behavior
The GridGrid Row should be adjusted in order and change values based on the data provided by PriceDataView. The object selected by the mouse should not be changed, and the number of lines the mouse hovers on should not be changed.
Avalonia version
11.3.8
Describe the bug
After setting the sorting rules using the DataSGrid Collections View, when the data changes and is reordered for display, there is a flashing screen issue when the mouse hovers over the DataGrid,
The source code is as follows:
.xaml
.cs
Expected behavior
The GridGrid Row should be adjusted in order and change values based on the data provided by PriceDataView. The object selected by the mouse should not be changed, and the number of lines the mouse hovers on should not be changed.
Avalonia version
11.3.8