|
|
|
|
using Aucma.Scada.UI.Page.InventoryInfo;
|
|
|
|
|
using GalaSoft.MvvmLight;
|
|
|
|
|
using GalaSoft.MvvmLight.Command;
|
|
|
|
|
using HighWayIot.Log4net;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Aucma.Scada.UI.viewModel.InventoryInfo
|
|
|
|
|
{
|
|
|
|
|
public class InventoryInfoViewModel : ViewModelBase
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
private LogHelper logHelper = LogHelper.Instance;
|
|
|
|
|
|
|
|
|
|
private ShellInventory shellInventory = new ShellInventory();
|
|
|
|
|
|
|
|
|
|
private LinerInventory linerInventory = new LinerInventory();
|
|
|
|
|
|
|
|
|
|
private BomFoamRearInventory boxFoamRearInventory = new BomFoamRearInventory();
|
|
|
|
|
|
|
|
|
|
public InventoryInfoViewModel()
|
|
|
|
|
{
|
|
|
|
|
InventoryOnClickCommand = new RelayCommand<object>(obj => InventoryOnClick(obj));
|
|
|
|
|
|
|
|
|
|
InventoryControl = boxFoamRearInventory;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 参数定义
|
|
|
|
|
public System.Windows.Controls.UserControl _content;
|
|
|
|
|
|
|
|
|
|
public System.Windows.Controls.UserControl InventoryControl
|
|
|
|
|
{
|
|
|
|
|
get { return _content; }
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_content = value;
|
|
|
|
|
RaisePropertyChanged(nameof(InventoryControl));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 事件定义
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 界面跳转按钮事件
|
|
|
|
|
/// </summary>
|
|
|
|
|
public RelayCommand<object> InventoryOnClickCommand { get; set; }
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 逻辑实现
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void InventoryOnClick(object obj)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string info = obj as string;
|
|
|
|
|
switch (info)
|
|
|
|
|
{
|
|
|
|
|
case "shellInventory":
|
|
|
|
|
InventoryControl = shellInventory;
|
|
|
|
|
break;
|
|
|
|
|
case "linerInventory":
|
|
|
|
|
InventoryControl = linerInventory;
|
|
|
|
|
break;
|
|
|
|
|
case "boxFoamRearInventory":
|
|
|
|
|
InventoryControl = boxFoamRearInventory;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
InventoryControl = shellInventory;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
logHelper.Error("界面跳转逻辑异常", ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|