Files
29WxOrder/29WxOrderWpf/Ctrls/OrderCtrls/OrderTransitListCtrl.xaml.cs
T
2026-10-23 19:38:28 +08:00

60 lines
1.4 KiB
C#

using AllBase.Model.DBModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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>
/// OrderTransitListCtrl.xaml 的交互逻辑
/// </summary>
public partial class OrderTransitListCtrl : UserControl
{
OrderTransitListCtrlViewModel ViewModel;
public OrderTransitListCtrl(oms_wei_order_item_transit_info transitInfo)
{
InitializeComponent();
ViewModel = new OrderTransitListCtrlViewModel(transitInfo);
ViewModel.RequestClose += ViewModel_RequestClose;
DataContext = ViewModel;
this.lbxTransitList.ItemsSource = ViewModel.TransitInfo.OrderItemTransitDetailList;
}
private void ViewModel_RequestClose()
{
Window parentWindow = Window.GetWindow(this);
if (this.IsLoaded && parentWindow != null)
parentWindow.Close();
}
private void OrderTransitListCtrl_Loaded(object sender, RoutedEventArgs e)
{
Window parentWindow = Window.GetWindow(this);
if (parentWindow != null)
{
parentWindow.Closed += ChangeWaybillView_Closed;
}
ViewModel.Start();
}
private void ChangeWaybillView_Closed(object sender, EventArgs e)
{
ViewModel.Stop();
}
}