private async void LoadStateBtn_Click(object sender, RoutedEventArgs e) { try { var appState = await _appStateService.Load(this); if (appState == null) { return; } Entries.Clear(); foreach (var entry in appState.Entries) { Entries.Add(new EntryViewModel(_timetable[entry.Number], entry)); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }