private async void SelectTimetable(TimetableDescription timetableDescription, Action doAfter)
        {
            await TimetableIO.SaveTimetable(App.Timetable);

            if (deleteWhenChanged != null)
            {
                await TimetableIO.DeleteTimetable(deleteWhenChanged.FileName);
                deleteWhenChanged = null;
            }

            var timetable = await TimetableIO.LoadTimetable(timetableDescription.FileName);
            if (timetable != null)
            {
                App.Timetable = timetable;
                doAfter();
            }
        }
        public async virtual void LoadData()
        {
            await TimetableIO.SaveTimetable(App.Timetable);
            this.timetables = new ObservableCollection<TimetableDescription>((await TimetableIO.LoadAllTimetableDescriptions()).OrderByDescending(p => p.FileName == App.Timetable.FileName).ThenBy(p => p.Name));
            this.Timetables = new ReadOnlyObservableCollection<TimetableDescription>(timetables);
            NotifyPropertyChanged("Timetables");

            this.DeleteCommand = new RelayCommandWithParameter(async p =>
            {
                var timetable = p as TimetableDescription;

                var messageDialog = new MessageDialog(string.Format(Strings.PageSelectTimetableDeleteWarning, timetable.Name), Strings.MessageBoxRemoveCaption);
                messageDialog.Commands.Add(new UICommand(Strings.MessageDialogOK, async x =>
                {
                    timetables.Remove(timetable);

                    if (App.Timetable.FileName == timetable.FileName)
                        deleteWhenChanged = timetable;
                    else
                        await TimetableIO.DeleteTimetable(timetable.FileName);
                }));

                messageDialog.Commands.Add(new UICommand(Strings.MessageDialogCancel));
                await messageDialog.ShowAsync();

            });

            this.AddCommand = new RelayCommand(async () => {
                var timetable = Timetable.CreateNew(Strings.TimetableNewName, await TimetableIO.ReserveNewTimetableFilename());
                await TimetableIO.SaveTimetable(timetable);
                timetables.Add(new TimetableDescription(timetable.FileName, timetable.Name, 0, 0));
            });

            this.SettingsCommand = new RelayCommandWithParameter(async p =>
            {
                var timetable = p as TimetableDescription;

                await TimetableIO.CopyTimetable(timetable.FileName);

                timetables.Add(new TimetableDescription(timetable.FileName, timetable.Name, timetable.HomeworksCount, timetable.DatesCount));
            });

            this.SelectCommand = new RelayCommandWithParameter(p => SelectTimetable((TimetableDescription)p, goBack));
            this.SettingsCommand = new RelayCommandWithParameter(p => SelectTimetable((TimetableDescription)p, goToSettings));
        }