public async Task Load(object user) { if (!GlobalHelper.IsInternet()) { //Sending NoInternet message to all viewModels Messenger.Default.Send(new GlobalHelper.LocalNotificationMessageType { Message = "No Internet", Glyph = "\uE704" }); } else { isLoading = true; if (user is string login) { if (!string.IsNullOrWhiteSpace(login)) { Developer = await UserUtility.GetUserInfo(login); } } else { Developer = user as User; if (Developer.Name == null) { Developer = await UserUtility.GetUserInfo(Developer.Login); } } if (Developer != null) { if (Developer.Type == AccountType.Organization || Developer.Login == GlobalHelper.UserLogin) { CanFollow = false; } else { CanFollow = true; FollowProgress = true; if (await UserUtility.CheckFollow(Developer.Login)) { IsFollowing = true; } FollowProgress = false; } IsEventsLoading = true; Events = await ActivityService.GetUserPerformedActivity(Developer.Login); IsEventsLoading = false; } isLoading = false; } }
public async Task Load(object user) { if (GlobalHelper.IsInternet()) { isLoading = true; if (user is string login) { if (!string.IsNullOrWhiteSpace(login)) { Developer = await UserUtility.GetUserInfo(login); } } else { Developer = user as User; if (Developer != null && Developer.Name == null) { Developer = await UserUtility.GetUserInfo(Developer.Login); } } if (Developer != null) { if (Developer.Type == AccountType.Organization || Developer.Login == GlobalHelper.UserLogin) { CanFollow = false; } else { CanFollow = true; FollowProgress = true; if (await UserUtility.CheckFollow(Developer.Login)) { IsFollowing = true; } FollowProgress = false; } IsEventsLoading = true; Events = await ActivityService.GetUserPerformedActivity(Developer.Login); IsEventsLoading = false; } isLoading = false; } }
public async Task Load(string login) { if (!GlobalHelper.IsInternet()) { Messenger.Default.Send(new GlobalHelper.NoInternetMessageType()); //Sending NoInternet message to all viewModels } else { Messenger.Default.Send(new GlobalHelper.HasInternetMessageType()); //Sending Internet available message to all viewModels if (!string.IsNullOrWhiteSpace(login)) { isLoading = true; Developer = await UserUtility.GetUserInfo(login); isLoading = false; if (Developer.Type == AccountType.Organization || Developer.Login == GlobalHelper.UserLogin) { CanFollow = false; } else { CanFollow = true; FollowProgress = true; if (await UserUtility.CheckFollow(Developer.Login)) { IsFollowing = true; } FollowProgress = false; FollowersLoading = true; Followers = await UserUtility.GetAllFollowers(Developer.Login); FollowersLoading = false; FollowingLoading = true; Following = await UserUtility.GetAllFollowing(Developer.Login); FollowingLoading = false; } } } }