public InstructionZonesViewModel(List<Guid> instructionZonesList, ZoneType zoneType) { AddOneCommand = new RelayCommand(OnAddOne, CanAddOne); RemoveOneCommand = new RelayCommand(OnRemoveOne, CanRemoveOne); AddAllCommand = new RelayCommand(OnAddAll, CanAddAll); RemoveAllCommand = new RelayCommand(OnRemoveAll, CanRemoveAll); Title = "Выбор зоны"; InstructionZonesList = new List<Guid>(instructionZonesList); InstructionZones = new ObservableCollection<ZoneViewModel>(); AvailableZones = new ObservableCollection<ZoneViewModel>(); InitializeZones(zoneType); if (InstructionZones.IsNotNullOrEmpty()) SelectedInstructionZone = InstructionZones[0]; }
public ZoneSelectionViewModel(List<Guid> zonesList) { AddOneCommand = new RelayCommand(OnAddOne, CanAddOne); RemoveOneCommand = new RelayCommand(OnRemoveOne, CanRemoveOne); AddAllCommand = new RelayCommand(OnAddAll, CanAddAll); RemoveAllCommand = new RelayCommand(OnRemoveAll, CanRemoveAll); Title = "Выбор зоны"; ChosenZonesList = new List<Guid>(zonesList); ChosenZones = new ObservableCollection<ZoneViewModel>(); AvailableZones = new ObservableCollection<ZoneViewModel>(); InitializeZones(); if (ChosenZones.IsNotNullOrEmpty()) SelectedChosenZone = ChosenZones[0]; }
public void Initialize() { DrawAllPlans(); Plans = new ObservableCollection<PlanViewModel>(); BuildTree(); if (Plans.IsNotNullOrEmpty()) SelectedPlan = Plans[0]; }
public void Initialize() { IsNowPlaying = false; Sounds = new ObservableCollection<SoundViewModel>(); foreach (StateType stateType in Enum.GetValues(typeof(StateType))) { if (stateType == StateType.No) { continue; } var newSound = new Sound() { StateType = stateType }; if (FiresecClient.FiresecManager.SystemConfiguration.Sounds.IsNotNullOrEmpty()) { var sound = FiresecClient.FiresecManager.SystemConfiguration.Sounds.FirstOrDefault(x => x.StateType == stateType); if (sound == null) FiresecClient.FiresecManager.SystemConfiguration.Sounds.Add(newSound); else newSound = sound; } else { FiresecClient.FiresecManager.SystemConfiguration.Sounds.Add(newSound); } Sounds.Add(new SoundViewModel(newSound)); } if (Sounds.IsNotNullOrEmpty()) SelectedSound = Sounds[0]; }