public DatabaseViewModel() { LoadData(); LoadAllFrageStatus(); Pruefungen.SelectMany(x => x.Fragen).ToList().ForEach(x => x.PropertyChanged += Frage_PropertyChanged); }
private void LoadAllFrageStatus() { saveDatabase.CreateTable <SaveDataViewModel>(); List <SaveDataViewModel> saveData = saveDatabase.Table <SaveDataViewModel>().ToList(); foreach (SaveDataViewModel save in saveData) { Pruefungen.SelectMany(x => x.Fragen).ToList().FirstOrDefault(x => x.Id == save.Id).Status = save.Status; } }
public void ResetAllData() { saveDatabase.DeleteAll <SaveDataViewModel>(); Pruefungen.SelectMany(x => x.Fragen).ToList().ForEach(x => { x.Status = FrageStatus.Unbearbeitet; x.Antworten.ToList().ForEach(y => y.Status = AntwortStatus.NotSelected); }); }