using GalaSoft.MvvmLight; using GalaSoft.MvvmLight.Command; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace Aucma.Scada.UI.viewModel.InventoryInfo { public class LinerInventoryViewModel :ViewModelBase { public List Shapes { get; set; } = new List(); public LinerInventoryViewModel() { UpdateCommand = new RelayCommand(obj => update(obj)); for (int i = 1; i <= 6; 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); } } }