public Task HandleMessageAsync(string json) { var user = json.ParseAsJson <UserModel>(); UserDataUpdated?.Invoke(user); return(Task.CompletedTask); }
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, EventArgs e) { var ee = e as LoginEventArg; await Task.CompletedTask; _user = new UserData { Name = ee.Name, Photo = ImageHelper.ImageFromAssetsFile("DefaultIcon.png"), UserPrincipalName = ee.Name }; UserDataUpdated?.Invoke(this, _user); }
private async void OnLoggedIn(object sender, EventArgs e) { _user = await GetUserFromGraphApiAsync(); UserDataUpdated?.Invoke(this, _user); }
protected virtual void OnUserDataUpdated() => UserDataUpdated?.Invoke(this, EventArgs.Empty);
void FireUserDataUpdated() { UserDataUpdated?.Invoke(this, null); }
private void OnLoggedIn(object sender, EventArgs e) { UserDataUpdated?.Invoke(this, _user); }