/// <summary>
 /// Log the user out of the account.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ButtonLogout_Clicked(object sender, EventArgs e)
 {
     this.ButtonLogout.IsEnabled = false;
     CredentialManager.Logout(true);
     this.OnSignedOut();
     this.Navigation.PopAsync();
 }
        /// <summary>
        /// Delete the user's acccount.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void ButtonDeleteAccount_Clicked(object sender, EventArgs e)
        {
            if (this.SetupFrameBegin(this.FrameDeleteAccount, this.StackLayoutDeleteAccountContent))
            {
                bool confirmed = await this.DisplayAlert("Confirm Delete", "" +
                                                         "Are you sure you want to delete your account? Your account cannot be recovered, and all created quizzes will be deleted.",
                                                         "Yes", "No");

                if (confirmed)
                {
                    string password = this.EntryEnterPasswordDeleteAccount.Text.Trim();
                    OperationReturnMessage message = await Task.Run(() => this.DeleteAccount(password));

                    if (message == OperationReturnMessage.True)
                    {
                        CredentialManager.Logout(true);
                        await this.DisplayAlert("Account Deletion", "Account successfully deleted", "OK");

                        this.OnSignedOut();
                        await this.Navigation.PopAsync();
                    }
                    else if (message == OperationReturnMessage.FalseNoConnection)
                    {
                        this.LabelDeleteAccountMessage.Text = "Failed to connect to server. Please try again.";
                    }
                    else
                    {
                        this.LabelDeleteAccountMessage.Text = "Incorrect password. Please try again.";
                    }
                }
            }
            this.SetupFrameEnd(this.StackLayoutDeleteAccountContent);
        }