private void btn_DoneAddSubject_Click(object sender, RoutedEventArgs e) { bool erfolgreich = true; if (edit) { SubjectManager.EditSubject(subject.id, tbx_Name_AddSubject.Text, tbx_Teacher_AddSubject.Text, SubjectColorManager.GetList().Find(x => x.name == (gvw_ColorPicker_AddSubject.SelectedItem as SubjectColor).name)); } else { erfolgreich = SubjectManager.AddSubject(tbx_Name_AddSubject.Text, tbx_Teacher_AddSubject.Text, (SubjectColor)gvw_ColorPicker_AddSubject.SelectedItem); } if (erfolgreich == true) { Frame.GoBack(); } }