private void SelectCheckedNodes() { LocalNodeInfoList.Clear(); if (EquipmentBusinessNodeMapModel.Equipment_Id == null) { EquipmentBusinessNodeMapModel.Equipment_Id = Guid.Empty; } if (EquipmentBusinessNodeMapModel.ProductionProcessInfo_Id == null) { EquipmentBusinessNodeMapModel.ProductionProcessInfo_Id = Guid.Empty; } nodemapmodel.Equipment_Id = EquipmentBusinessNodeMapModel.Equipment_Id; nodemapmodel.BusinessNode_Id = EquipmentBusinessNodeMapModel.BusinessNode_Id; nodemapmodel.ProductionProcessInfo_Id = equipmentBusinessNodeMapModel.ProductionProcessInfo_Id; for (int i = 0; i < NodeInfoList.Count; i++) { NodeInfoList[i].IsChecked = false; } GetNodeInfoByIds(nodemapmodel); if (ExistNodeInfoList.Any()) { foreach (var data in ExistNodeInfoList) { for (int i = 0; i < NodeInfoList.Count; i++) { if (data.DeviceNode_Id == NodeInfoList[i].Id) { NodeInfoList[i].IsChecked = true; } } } } }
void OnPropertyChangedCommand(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName.Equals("IsChecked")) { var selectedObj = sender as CommOpcUaNodeModel; if (selectedObj == null) { return; } if (selectedObj.IsChecked) { LocalNodeInfoList.Add(selectedObj); } else if (!selectedObj.IsChecked) { LocalNodeInfoList.Remove(selectedObj); } } }
private void SelectCheckedNodes() { LocalNodeInfoList.Clear(); nodemapmodel.EquipmentID = CommOpcUaBusinessNodeMapModel.EquipmentID; nodemapmodel.OpcUaBusiness_Id = CommOpcUaBusinessNodeMapModel.OpcUaBusiness_Id; for (int i = 0; i < NodeInfoList.Count; i++) { NodeInfoList[i].IsChecked = false; } GetNodeInfoByIds(nodemapmodel); if (ExistNodeInfoList.Any()) { foreach (var data in ExistNodeInfoList) { for (int i = 0; i < NodeInfoList.Count; i++) { if (data.OpcUaNode_Id == NodeInfoList[i].Id) { NodeInfoList[i].IsChecked = true; } } } } }