Пример #1
0
		public DeviceDetailsViewModel(GKDevice device)
		{
			ShowCommand = new RelayCommand(OnShow);
			ShowParentCommand = new RelayCommand(OnShowParent, CanShowParent);
			ShowZoneCommand = new RelayCommand(OnShowZone);
			ShowJournalCommand = new RelayCommand(OnShowJournal);
			Device = device;
			DeviceStateViewModel = new DeviceStateViewModel(State, device.Driver.IsAm);
			State.StateChanged += OnStateChanged;
			State.MeasureParametersChanged += OnMeasureParametersChanged;
			DeviceCommandsViewModel = new DeviceCommandsViewModel(Device);
			DevicePropertiesViewModel = new DevicePropertiesViewModel(Device);
			PlanLinks = new PlanLinksViewModel(Device);

			Title = Device.PresentationName;
			StartMeasureParametersMonitoring();

			ServiceFactory.Events.GetEvent<GKObjectsPropertyChangedEvent>().Unsubscribe(OnGKObjectsPropertyChanged);
			ServiceFactory.Events.GetEvent<GKObjectsPropertyChangedEvent>().Subscribe(OnGKObjectsPropertyChanged);
		}
Пример #2
0
		public DeviceDetailsViewModel(XDevice device)
		{
			ShowCommand = new RelayCommand(OnShow);
			ShowParentCommand = new RelayCommand(OnShowParent, CanShowParent);
			ShowOnPlanCommand = new RelayCommand<Plan>(OnShowOnPlan);
			ShowZoneCommand = new RelayCommand(OnShowZone);
			ShowJournalCommand = new RelayCommand(OnShowJournal);

			Device = device;
			DeviceStateViewModel = new DeviceStateViewModel(State);
			State.StateChanged += new Action(OnStateChanged);
			State.MeasureParametersChanged += new Action(OnMeasureParametersChanged);
			DeviceCommandsViewModel = new DeviceCommandsViewModel(Device);
			DevicePropertiesViewModel = new DevicePropertiesViewModel(Device);
			InitializePlans();

			Title = Device.PresentationName;
			TopMost = true;

			StartMeasureParametersMonitoring();
		}
Пример #3
0
		void OnGKObjectsPropertyChanged(GKPropertyChangedCallback gkPropertyChangedCallback)
		{
			DevicePropertiesViewModel = new DevicePropertiesViewModel(Device);
			OnPropertyChanged(() => DevicePropertiesViewModel);
		}