private void UpdateStepsList(AchievementStepViewModel viewModel)
        {
            if (!AchievementSteps.Contains(viewModel))
            {
                AchievementSteps.Add(viewModel);
            }

            GeneralTimeSpent = AchievementSteps.Sum(x => x.TimeSpent);
            IsEditMode       = true;
        }
 public override Task InitializeAsync(object navigationData)
 {
     if (navigationData is AchievementStepViewModel model)
     {
         _viewModel   = model;
         Title        = _viewModel.Title;
         NotesText    = _viewModel.Description;
         TimeSpent    = _viewModel.TimeSpent.ToString();
         AchievedDate =
             _viewModel.AchievedDate == DateTime.MinValue
             ? DateTime.Now
             : _viewModel.AchievedDate;
     }
     return(base.InitializeAsync(navigationData));
 }
        private async Task DeleteStep(AchievementStepViewModel viewModel)
        {
            bool result = await UserDialogs.Instance.ConfirmAsync(
                ConstantsHelper.AchievementStepDeleteMessage,
                ConstantsHelper.Warning,
                ConstantsHelper.Ok,
                ConstantsHelper.Cancel);

            if (result)
            {
                AchievementSteps.Remove(viewModel);
                GeneralTimeSpent = AchievementSteps.Sum(x => x.TimeSpent);
                if (!_stepsToDelete.Contains(viewModel))
                {
                    _stepsToDelete.Add(viewModel);
                }
                IsEditMode = true;
            }
        }
 private Task NavigateToAchievementStepEditView(AchievementStepViewModel model)
 {
     return(NavigationService.NavigateToPopupAsync <AchievementStepEditViewModel>(model));
 }