Beispiel #1
0
        private async void OpenEditEatingDayDialogAsync(EatingDay day)
        {
            var dayClone = day.Clone();

            var dialog = _dialogs.For <EatingDayDialogViewModel>(DialogsIdentifier);

            dialog.Data.DialogTitle       = "Modified day";
            dialog.Data.SubmitButtonTitle = "Save";
            dialog.Data.EatingDay         = EatingDayViewModel.FromModel(dayClone);

            var dialogResult = await dialog.Show();

            if (dialogResult != DialogResult.Ok)
            {
                return;
            }

            dayClone = dialog.Data.EatingDay.ToModel();
            Days.Replace(day, dayClone);
            _eatingDayRepository.Update(dayClone);
        }