/// <summary> /// when the user is logged in, set up events for potential logout /// </summary> /// <param name="source"></param> /// <param name="eventArgs"></param> public async void OnLoggedIn(object source, EventArgs eventArgs) { this.accountSettingsPage = new AccountSettingsPage(); this.accountSettingsPage.SignedOut += this.OnSignedOut; this.accountSettingsPage.SignedOut += this.LocalLoginPage.OnSignout; await this.UpdateProfilePageAsync(); }
/// <summary> /// Opens the account settings page when the user clicks the account settings toolbar icon /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void ToolbarItemAccountSettings_Clicked(object sender, EventArgs e) { if (this.accountSettingsPage == null) { this.accountSettingsPage = new AccountSettingsPage(); this.accountSettingsPage.SignedOut += this.OnSignedOut; this.accountSettingsPage.SignedOut += this.LocalLoginPage.OnSignout; } await this.Navigation.PushAsync(this.accountSettingsPage); }
/// <summary> /// When the user is logged out, unload the account settings page and refresh the profile tab /// </summary> /// <param name="source"></param> /// <param name="eventArgs"></param> public async void OnSignedOut(object source, EventArgs eventArgs) { this.accountSettingsPage = null; await this.UpdateProfilePageAsync(); }