コード例 #1
0
        public DeviceDetailsViewModel(Guid deviceUID)
        {
            _guid = deviceUID;
            Device = FiresecManager.Devices.FirstOrDefault(x => x.UID == deviceUID);
            DeviceState = FiresecManager.DeviceStates.DeviceStates.FirstOrDefault(x => x.UID == deviceUID);
            if (DeviceState != null)
                DeviceState.StateChanged += new Action(deviceState_StateChanged);
            DeviceControlViewModel = new DeviceControlViewModel(Device);
            ValveControlViewModel = new ValveControlViewModel(Device);

            Title = Device.Driver.ShortName + " " + Device.DottedAddress;
            TopMost = true;
        }
コード例 #2
0
		public DeviceDetailsViewModel(Device device, Guid alternativeLibraryDeviceUID)
		{
			ShowZoneCommand = new RelayCommand(OnShowZone, CanShowZone);
			ShowParentCommand = new RelayCommand(OnShowParent, CanShowParent);
			ShowOnPlanCommand = new RelayCommand(OnShowOnPlan, CanShowOnPlan);
			Device = device;
			AlternativeLibraryDeviceUID = alternativeLibraryDeviceUID;
			DeviceState = Device.DeviceState;
			DeviceControlViewModel = new DeviceControlViewModel(Device);
			DeviceState.StateChanged += new Action(OnStateChanged);
			DeviceState.ParametersChanged += new Action(OnParametersChanged);
			OnStateChanged();

			Title = Device.DottedPresentationAddressAndName;
			TopMost = true;
		}