private async void OnLoggedIn(object sender, UserLoginEventArg e) { _user = e.User; if (!string.IsNullOrEmpty(IdentityService.GeneratedApiKey)) { _httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", IdentityService.GeneratedApiKey); WaniKaniApi = RestService.For <IWaniKaniApi>(_httpClient); } await ApplicationData.Current.LocalFolder.SaveAsync(_userSettingsKey, e.User); UserDataUpdated?.Invoke(this, new UserLoginEventArg(_user)); }
private async void OnLoggedIn(object sender, UserLoginEventArg e) { if (IdentityService.IsLoggedIn()) { await ThemeSelectorService.SetRequestedThemeAsync(); await HandleActivationAsync(_lastActivationArgs); if (_shell?.Value != null) { Window.Current.Content = _shell.Value; } else { var frame = new Frame(); Window.Current.Content = frame; NavigationService.Frame = frame; } } }
private async void OnLoggedOut(object sender, UserLoginEventArg e) { _user = null; await ApplicationData.Current.LocalFolder.SaveAsync <UserViewModel>(_userSettingsKey, null); }
private void OnUserDataUpdated(object sender, UserLoginEventArg userData) { User = userData.User; }