优化订单读取卡顿问题

This commit is contained in:
wule committed 2026-10-17 07:13:38 +08:00
1 parent c83521f36d
commit 1509e0a11d
15 files changed
+718 -542

No files matched your search

@@ -41,20 +41,22 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
private async void OrderListRowCtrl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
if (this.DataContext is oms_wei_order_info order)
{
int index = 0;
foreach (var orderItem in order.orderItems)
{
gridChildOrder.RowDefinitions.Insert(gridChildOrder.RowDefinitions.Count - 1, new RowDefinition() { Height = GridLength.Auto });
index++;
var rowItem = new OrderListRowItemCtrl() { DataContext = orderItem, Name = "rowItem" + index };
Grid.SetRow(rowItem, index);
this.gridChildOrder.Children.Add(rowItem);
if (index >= 5)
break;
}
}
//await Task.Run(() => { });
//
//if (this.DataContext is oms_wei_order_info order)
//{
// int index = 0;
// foreach (var orderItem in order.orderItems)
// {
// gridChildOrder.RowDefinitions.Insert(gridChildOrder.RowDefinitions.Count - 1, new RowDefinition() { Height = GridLength.Auto });
// index++;
// var rowItem = new OrderListRowItemCtrl() { DataContext = orderItem, Name = "rowItem" + index };
// Grid.SetRow(rowItem, index);
// this.gridChildOrder.Children.Add(rowItem);
// if (index >= 5)
// break;
// }
//}
}
private void CheckBox_Click(object sender, RoutedEventArgs e)