private async void ChangePasswordButton_Click(object sender, RoutedEventArgs e)
        {
            ResetDisplay();
            ChangePassword changePassword = new ChangePassword()
            {
                OldPassword = OldPasswordBox.Password,
                NewPassword = NewPasswordBox.Password,
                ConfirmPassword = ConfirmPasswordBox.Password
            };

            HttpResult result;
            using (AccountClient accountClient = ClientFactory.CreateAccountClient())
            {
                result = await accountClient.ChangePasswordAsync(changePassword);
            }

            if (result.Succeeded)
            {
                AppSettings settings = new AppSettings();
                settings.ChangePasswordCredential(username, changePassword.NewPassword);
                DisplaySuccess(); 
            }
            else
            {
                DisplayErrors(result.Errors);
            }
            ClearPasswords();
        }
        private async void ChangePasswordButton_Click(object sender, RoutedEventArgs e)
        {
            ClearErrors();
            ChangePassword changePassword = new ChangePassword()
            {
                OldPassword = OldPasswordBox.Password,
                NewPassword = NewPasswordBox.Password,
                ConfirmPassword = ConfirmPasswordBox.Password
            };

            HttpResult result;
            using (AccountClient accountClient = ClientFactory.CreateAccountClient())
            {
                result = await accountClient.ChangePasswordAsync(changePassword);
            }
            
            if (result.Succeeded)
            {
                this.NavigationService.GoBack();
            }
            else
            {
                DisplayErrors(result.Errors);
            }
            ClearPasswords();
        }
 public async Task<HttpResult<ChangePasswordResponse>> ChangePasswordAsync(ChangePassword changePassword)
 {
     ThrowIfDisposed();
     HttpResult<ChangePasswordResponse> result = await HttpClient.PostAsJsonAsync<ChangePassword, ChangePasswordResponse>(ChangePasswordUri, changePassword);
     AddAllErrors(result, result.Content);
     return result;
 }