using Aitex.Core.UI.MVVM; using Aitex.Sorter.Common; using Aitex.Sorter.UI.Controls.Common; using MECF.Framework.Common.OperationCenter; using System.Collections.Generic; using System.Windows; using System.Windows.Input; namespace Aitex.Sorter.UI.ViewModel.Maintenance { public class AlignerViewModel : UIViewModelBase { public AlignerViewModel(string vmName) : base(vmName) { Command = new DelegateCommand(DoCommand); } public bool AlignerInitialized { get; set; } public bool AlignerIsBusy { get; set; } public bool AlignerIsError { get; set; } public string ElapseTime { get; set; } public int Notch { get; set; } public string AlignerStatus { get; set; } public ICommand Command { get; private set; } private void DoCommand(DependencyObject sender) { var command = CommandHelper.GetCommandItem(sender); var lstParameter = new List(command.Parameters); lstParameter.Insert(0, command.Target); lstParameter.Insert(1, command.CommandName); InvokeClient.Instance.Service.DoOperation(OperationName.DeviceOperation, lstParameter.ToArray()); } } }