Пример #1
0
        protected async Task ChangePasswordAsync()
        {
            if (string.IsNullOrWhiteSpace(ChangePasswordModel.CurrentPassword))
            {
                return;
            }

            if (ChangePasswordModel.NewPassword != ChangePasswordModel.NewPasswordConfirm)
            {
                await UiMessageService.WarnAsync(L["NewPasswordConfirmFailed"]);

                return;
            }

            if (!await UiMessageService.ConfirmAsync(UiLocalizer["AreYouSure"]))
            {
                return;
            }

            await ProfileAppService.ChangePasswordAsync(new ChangePasswordInput
            {
                CurrentPassword = ChangePasswordModel.CurrentPassword,
                NewPassword     = ChangePasswordModel.NewPassword
            });

            await UiMessageService.SuccessAsync(L["PasswordChanged"]);
        }
Пример #2
0
 async Task OnConfirmTestClicked()
 {
     if (await UiMessageService.ConfirmAsync("Are you sure you want to delete the item?", "Confirm", options =>
     {
         options.CancelButtonText = "Do not delete it";
         options.ConfirmButtonText = "Yes I'm sure";
     }))
     {
         Console.WriteLine("Confirmed");
     }
 }
Пример #3
0
        private async Task DeleteAuthorAsync(AuthorDto author)
        {
            var confirmMessage = L["AuthorDeletionConfirmationMessage", author.Name];

            if (!await UiMessageService.ConfirmAsync(confirmMessage))
            {
                return;
            }

            await AuthorAppService.DeleteAsync(author.Id);

            await GetAuthorsAsync();
        }
Пример #4
0
        protected async Task UpdatePersonalInfoAsync()
        {
            if (!await UiMessageService.ConfirmAsync(UiLocalizer["AreYouSure"]))
            {
                return;
            }

            await ProfileAppService.UpdateAsync(
                ObjectMapper.Map <PersonalInfoModel, UpdateProfileDto>(PersonalInfoModel)
                );

            await UiMessageService.SuccessAsync(L["PersonalSettingsSaved"]);
        }
Пример #5
0
 Task OnConfirmTestClicked()
 {
     return(UiMessageService.ConfirmAsync("Are you sure you want to delete the item?", "Confirm", options =>
     {
         options.CancelButtonText = "Do not delete it";
         options.ConfirmButtonText = "Yes I'm sure";
     })
            .ContinueWith(result =>
     {
         if (result.Result)
         {
             Console.WriteLine("Confirmed");
         }
         else
         {
             Console.WriteLine("Cancelled");
         }
     }));
 }