93 lines
2.8 KiB
C#
93 lines
2.8 KiB
C#
using _29WxOrderWpf.BaseWindows;
|
|
using AllBase.Model.DBModel;
|
|
using NaiBa.Util.Extension;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
|
|
namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|
{
|
|
/// <summary>
|
|
/// OrderListRowCtrl.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class OrderListRowCtrl : UserControl
|
|
{
|
|
public OrderListRowCtrl()
|
|
{
|
|
InitializeComponent();
|
|
|
|
//BitmapImage bitImage = new BitmapImage();
|
|
//bitImage.BeginInit();
|
|
//bitImage.UriSource = new Uri(imageUrl, UriKind.Absolute);
|
|
//bitImage.EndInit();
|
|
//img.Source = bitImage;
|
|
|
|
|
|
//gridChildOrder.Children.Clear();
|
|
this.DataContextChanged += OrderListRowCtrl_DataContextChanged;
|
|
}
|
|
|
|
private void OrderListRowCtrl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
|
{
|
|
if (this.DataContext is oms_wei_order_info order)
|
|
{
|
|
//Task.Run(() =>
|
|
//{
|
|
int index = 0;
|
|
foreach (var orderItem in order.orderItems)
|
|
{
|
|
gridChildOrder.RowDefinitions.Insert(gridChildOrder.RowDefinitions.Count - 1, new RowDefinition() { Height = GridLength.Auto });
|
|
//Thread.Sleep(5);
|
|
index++;
|
|
//Dispatcher.Invoke(new Action(() =>
|
|
//{
|
|
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)
|
|
{
|
|
try
|
|
{
|
|
MainWindow.Instance.orderListCtrl.UpdateChkAllBox();
|
|
}
|
|
catch
|
|
{
|
|
}
|
|
}
|
|
|
|
private void btnSeeAddressDetail_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
var order = this.DataContext as oms_wei_order_info;
|
|
if (order == null)
|
|
return;
|
|
}
|
|
|
|
private void btnGetRefundAddress_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
var order = this.DataContext as oms_wei_order_info;
|
|
if (order == null)
|
|
return;
|
|
}
|
|
}
|
|
}
|