public void Initialize()
		{
			Cameras = new ObservableCollection<CameraViewModel>();
			foreach (var camera in ClientManager.SystemConfiguration.Cameras)
			{
				var cameraViewModel = new CameraViewModel(CamerasViewModel.Current, camera, camera.PresentationName);
				Cameras.Add(cameraViewModel);
			}
			SelectedCamera = Cameras.FirstOrDefault();
		}
Example #2
0
		void OnAdd()
		{
			var cameraDetailsViewModel = new CameraDetailsViewModel();
			if (DialogService.ShowModalWindow(cameraDetailsViewModel))
			{
				FiresecManager.SystemConfiguration.Cameras.Add(cameraDetailsViewModel.Camera);
				var cameraViewModel = new CameraViewModel(cameraDetailsViewModel.Camera);
				Cameras.Add(cameraViewModel);
				SelectedCamera = cameraViewModel;
				ServiceFactory.SaveService.CamerasChanged = true;
			}
		}
Example #3
0
		public void Initialize()
		{
			Cameras = new ObservableCollection<CameraViewModel>();

			if (FiresecManager.SystemConfiguration.Cameras == null)
				FiresecManager.SystemConfiguration.Cameras = new List<Camera>();

			foreach (var camera in FiresecManager.SystemConfiguration.Cameras)
			{
				var cameraViewModel = new CameraViewModel(camera);
				Cameras.Add(cameraViewModel);
			}
			SelectedCamera = Cameras.FirstOrDefault();
		}
		public CameraSelectionViewModel(Camera camera)
		{
			Title = "Выбор видеоустройства";
			Cameras = new ObservableCollection<CameraViewModel>();
			foreach (var cam in ClientManager.SystemConfiguration.Cameras)
			{
				var cameraViewModel = new CameraViewModel(null, cam, cam.PresentationName);
				Cameras.Add(cameraViewModel);
			}

			if (camera != null)
				SelectedCamera = Cameras.FirstOrDefault(x => x.Camera.UID == camera.UID);
			if (SelectedCamera == null)
				SelectedCamera = Cameras.FirstOrDefault();
		}