Example #1
0
        /// <summary> Konstruktor </summary>
        /// <param name="scenarioRepository"> Verzeichnis für alle Szenarien </param>
        /// <param name="scenarioName"> Titel des Szenarios </param>
        public TobiiViewModel(ScenarioRepository scenarioRepository, string scenarioName)
        {
            base.DisplayName = Strings.TobiiViewModel_DisplayName;

            _scenarioRepository = scenarioRepository ?? throw new ArgumentNullException("scenarioRepository");
            scenario            = _scenarioRepository.GetScenarios(scenarioName);
        }
        /// <summary> Erstellt alle Szenarien bei Programmstart </summary>
        void CreateAllScenarios()
        {
            List <Scenario> all = _scenarioRepository.GetScenarios();

            foreach (Scenario cvm in all)
            {
                cvm.PropertyChanged += this.OnScenarioPropertyChanged;
            }

            this.AllScenarios = new ObservableCollection <Scenario>(all);
        }
Example #3
0
        /// <summary> Erstellt das Navigationsmenü </summary>
        List <CommandViewModel> CreateCommands()
        {
            int             i   = 0;
            List <Scenario> all =
                _scenarioRepository.GetScenarios();
            List <CommandViewModel> list = new List <CommandViewModel> {
            };

            for (i = 0; i <= all.Count - 1; i++)
            {
                string titel = all.ElementAt(i).Titel;
                list.Add(new CommandViewModel(
                             all.ElementAt(i).Titel,
                             new RelayCommand(param => this.ShowScenario(titel))));
            }

            list.Add(new CommandViewModel(
                         Strings.MainWindowViewModel_Command_CreateNewScenario,
                         new RelayCommand(param => this.CreateNewScenario())));
            list.Add(new CommandViewModel(
                         Strings.MainWindowViewModel_Command_DeleteScenario,
                         new RelayCommand(param => this.DeleteScenario())));
            return(list);
        }