解决虚拟化时候索引超出范围的bug

This commit is contained in:
小红帽 2024-04-23 21:53:31 +08:00
parent 379d2367f3
commit 9191f3d1ec

View File

@ -1031,7 +1031,7 @@ namespace CPF.Controls
item.IsSetOnOwner = false;
OnSetItem(item);
}
else
else if(index < Items.Count)
{
var item = stackPanel.Children[i] as T;
item.DataContext = Items[index];