using GalaSoft.MvvmLight; using GalaSoft.MvvmLight.Command; using System.Collections.Generic; using System.Windows; namespace Aucma.Scada.UI.viewModel.InventoryInfo { public class ShellInventoryViewModel : ViewModelBase { public List Shapes { get; set; } = new List(); public ShellInventoryViewModel() { UpdateCommand = new RelayCommand(obj => update(obj)); for (int i = 1; i <= 9; i++) { Shapes.Add(new SpaceDto() { spaceCode = i + "#", spaceStock = i, onTheWay = i, totalAmount = i+i, materialType = "", inStoreFlag = 1, outStoreFlag = 2, unusualFlag = 2, isFlag = 1, onlyOne = 1, spaceType = 1 }); } } #region 事件定义 /// /// 界面跳转按钮事件 /// public RelayCommand UpdateCommand { get; set; } #endregion private void update(object obj) { string info = obj as string; MessageBox.Show("编号:" + info); } } /// /// 货道信息 /// public class SpaceDto { /// /// 货道编号 /// public string spaceCode { get; set; } /// /// 在库数量 /// public int spaceStock { get; set; } /// /// 货道类型 /// public int spaceType { get; set; } /// /// 在途数量 /// public int onTheWay { get; set; } /// /// 合计数量 /// public int totalAmount { get; set; } /// /// 物料型号 /// public string materialType { get; set; } /// /// 入库状态 /// public int inStoreFlag { get; set; } /// /// 出库状态 /// public int outStoreFlag { get; set; } /// /// 异常状态 /// public int unusualFlag { get; set; } /// /// 禁用状态 /// public int isFlag { get; set; } /// /// 出一个 /// public int onlyOne { get; set; } } }