public ClauseViewModel(ZoneLogicViewModel zoneLogicViewModel, Device device, Clause clause) { ShowZonesCommand = new RelayCommand(OnShowZones); SelectDeviceCommand = new RelayCommand(OnSelectDevice); _zoneLogicViewModel = zoneLogicViewModel; Device = device; Zones = new List<Guid>( from zoneUID in clause.ZoneUIDs select zoneUID); Zones = clause.ZoneUIDs.ToList(); _selectedState = clause.State; SelectedOperation = clause.Operation; if (clause.DeviceUIDs == null) { clause.DeviceUIDs = new List<Guid>(); } SelectedDevices = new List<Device>(); foreach (var deviceUID in clause.DeviceUIDs) { var deviceInClause = FiresecManager.Devices.FirstOrDefault(x => x.UID == deviceUID); if (deviceInClause != null) { SelectedDevices.Add(deviceInClause); } } SelectedMROMessageNo = clause.ZoneLogicMROMessageNo; SelectedMROMessageType = clause.ZoneLogicMROMessageType; }
void OnShowZoneLogic() { var zoneLogicViewModel = new ZoneLogicViewModel(SelectedDevice.Device); if (DialogService.ShowModalWindow(zoneLogicViewModel)) { ServiceFactory.SaveService.DevicesChanged = true; Initialize(_zoneNo); } }