/// <summary> Löscht das ausgewählte Szenario </summary> public void Delete() { /// <summary> Index des ausgewählten Szenarios </summary> int index = AllScenarios.IndexOf(AllScenarios.Where(p => p.IsSelected == true).FirstOrDefault()); Scenario scenario = AllScenarios.ElementAt(index); _scenarioRepository.DeleteScenario(scenario); BlueBlue = null; BlueRed = null; BlueGreen = null; BlueYellow = null; RedBlue = null; RedRed = null; RedGreen = null; RedYellow = null; GreenBlue = null; GreenRed = null; GreenGreen = null; GreenYellow = null; YellowBlue = null; YellowRed = null; YellowGreen = null; YellowYellow = null; IsListItemSelected = false; base.OnPropertyChanged("IsListItemSelected"); }
/// <summary> Event wird ausgelöst, wenn Item in der Liste ausgewählt wird </summary> /// <param name="sender"> Objekt von dem das Event ausgeht</param> /// <param name="e"> Ausgelöstes Event </param> void OnScenarioPropertyChanged(object sender, PropertyChangedEventArgs e) { string IsSelected = "IsSelected"; (sender as Scenario).VerifyPropertyName(IsSelected); IsListItemSelected = false; base.OnPropertyChanged("IsListItemSelected"); if (e.PropertyName == IsSelected) { if ((sender as Scenario).IsSelected) { _index = AllScenarios.IndexOf(AllScenarios.Where(p => p.IsSelected == true).FirstOrDefault()); BlueBlue = AllScenarios.ElementAt(_index).BlueBlue; BlueRed = AllScenarios.ElementAt(_index).BlueRed; BlueGreen = AllScenarios.ElementAt(_index).BlueGreen; BlueYellow = AllScenarios.ElementAt(_index).BlueYellow; RedBlue = AllScenarios.ElementAt(_index).RedBlue; RedRed = AllScenarios.ElementAt(_index).RedRed; RedGreen = AllScenarios.ElementAt(_index).RedGreen; RedYellow = AllScenarios.ElementAt(_index).RedYellow; GreenBlue = AllScenarios.ElementAt(_index).GreenBlue; GreenRed = AllScenarios.ElementAt(_index).GreenRed; GreenGreen = AllScenarios.ElementAt(_index).GreenGreen; GreenYellow = AllScenarios.ElementAt(_index).GreenYellow; YellowBlue = AllScenarios.ElementAt(_index).YellowBlue; YellowRed = AllScenarios.ElementAt(_index).YellowRed; YellowGreen = AllScenarios.ElementAt(_index).YellowGreen; YellowYellow = AllScenarios.ElementAt(_index).YellowYellow; IsListItemSelected = true; base.OnPropertyChanged("IsListItemSelected"); } } }