using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Toolkit.Mvvm.ComponentModel; using System.Collections.ObjectModel; using BPASmartClient.JXJFoodSmallStation.Model; using BPASmartClient.Helper; using Microsoft.Toolkit.Mvvm.Input; using BPASmartClient.CustomResource.UserControls.MessageShow; using BPASmartClient.CustomResource.UserControls; using System.Diagnostics; using BPASmartClient.JXJFoodSmallStation.Model.Siemens; using BPASmartClient.JXJFoodSmallStation.Model.HK_PLC; namespace BPASmartClient.JXJFoodSmallStation.ViewModel { public class ManualCommViewModel : ObservableObject { public ManualCommViewModel() { PlcDataColl.Add(new VarMonitor() { SerialNum = PlcDataColl.Count , Address="",}); SetParCommand = new RelayCommand((o) => { if (o != null && o is string address) { var res = PlcDataColl.FirstOrDefault(p =>p.Address == address); } }); } public static ObservableCollection PlcDataColl { get; set; } = new ObservableCollection(); public RelayCommand SetParCommand { get; set; } public RelayCommand Connect { get; set; } } }