public void onMachineDownLine(LYLUserMachineInfo machine) { var findmachine = myMachines.FirstOrDefault(o => o.machineId == machine.machineId); if (findmachine != null) { this.myMachines.Remove(findmachine); this.OnPropertyChanged(nameof(this.myMachines)); } }
public void onMachineOnLine(websocketMsgTemp <LYLUserMachineInfo> data) { LYLUserMachineInfo machine = data.content; var findmachine = myMachines.FirstOrDefault(o => o.machineId == machine.machineId); if (findmachine == null) { this.myMachines.Add(machine); } else { findmachine.machinePwd = machine.machinePwd; findmachine.machineName = machine.machineName; } this.OnPropertyChanged(nameof(this.myMachines)); }