using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Windows; using System.Windows.Input; using Aitex.Core.Common.DeviceData; using Aitex.Core.UI.MVVM; using Aitex.Core.Util; using Aitex.Sorter.UI.ViewModel; using MECF.Framework.Common.IOCore; namespace Aitex.Sorter.UI.ViewModel { public class IoViewModelOnly1Card : UIViewModelBase { public ObservableCollection Card1DiList { get; set; } public ObservableCollection Card1DoList { get; set; } private List _di; [Subscription("System.dio000.DIList")] public List DiListData { get { return _di; } set { _di = value; Application.Current.Dispatcher.Invoke(new Action(() => { Card1DiList.Clear(); _di.ForEach(x => { if (x.Provider.ToLower() == "system.dio000") Card1DiList.Add(x); }); })); } } private List _do; [Subscription("System.dio000.DOList")] public List DoListData { get { return _do; } set { _do = value; Application.Current.Dispatcher.Invoke(new Action(() => { Card1DoList.Clear(); _do.ForEach(x => { if (x.Provider.ToLower() == "system.dio000") Card1DoList.Add(x); }); })); } } public ICommand SetDoCommand { get; set; } public IoViewModelOnly1Card() : base("IoViewModelOnly1Card") { Card1DiList = new ObservableCollection(); Card1DoList = new ObservableCollection(); SetDoCommand = new DelegateCommand(PerformSetDo); } private void PerformSetDo(string ioName) { } private void SetDo() { } protected override void InvokeBeforeUpdateProperty(Dictionary data) { //data[UIKey(UnitName.System.ToString(), ParamName.WaferInfoRobotAligner01)] = new WaferInfo("dummy", WaferStatus.Normal); } } }