|
- using BPASmartClient.FoodStationTest.Model;
- using Microsoft.Toolkit.Mvvm.ComponentModel;
- using Microsoft.Toolkit.Mvvm.Input;
- using System.Collections.ObjectModel;
- using System.Linq;
-
- namespace BPASmartClient.FoodStationTest.ViewModel
- {
- public class ManualCommViewModel : ObservableObject
- {
- public ManualCommViewModel()
- {
- PlcDataColl.Add(new VarMonitor() { SerialNum = PlcDataColl.Count, Address = "", });
- SetParCommand = new RelayCommand<object>((o) =>
- {
- if (o != null && o is string address)
- {
- var res = PlcDataColl.FirstOrDefault(p => p.Address == address);
- }
- });
- }
- public static ObservableCollection<VarMonitor> PlcDataColl { get; set; } = new ObservableCollection<VarMonitor>();
-
- public RelayCommand<object> SetParCommand { get; set; }
-
- public RelayCommand Connect { get; set; }
-
- }
- }
|