public async void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Pivot p = sender as Pivot;

            if (p.SelectedIndex == 0)
            {
                IsEventsLoading = true;
                if (Developer != null)
                {
                    Events = await ActivityService.GetUserPerformedActivity(Developer.Login);
                }
                IsEventsLoading = false;
            }
            else if (p.SelectedIndex == 1)
            {
                IsReposLoading = true;
                await LoadRepos();

                IsReposLoading = false;
            }
            else if (p.SelectedIndex == 2)
            {
                IsFollowersLoading = true;
                Followers          = await UserUtility.GetAllFollowers(Developer.Login);

                IsFollowersLoading = false;
            }
            else if (p.SelectedIndex == 3)
            {
                IsFollowingLoading = true;
                Following          = await UserUtility.GetAllFollowing(Developer.Login);

                IsFollowingLoading = false;
            }
        }
Exemplo n.º 2
0
        public async void FollowActivity(GlobalHelper.FollowActivityMessageType empty)
        {
            Developer = await UserUtility.GetUserInfo(Developer.Login);

            FollowersLoading = true;
            Followers        = await UserUtility.GetAllFollowers(Developer.Login);

            FollowersLoading = false;
        }
Exemplo n.º 3
0
        public async Task Load()
        {
            if (!GlobalHelper.IsInternet())
            {
                //Sending NoInternet message to all viewModels
                Messenger.Default.Send(new GlobalHelper.NoInternetMessageType());
            }
            else
            {
                //Sending Internet available message to all viewModels
                Messenger.Default.Send(new GlobalHelper.HasInternetMessageType());

                isLoading = true;

                if (User != null)
                {
                    if (GlobalHelper.NewFollowActivity)
                    {
                        User = await UserUtility.GetUserInfo(User.Login);

                        GlobalHelper.NewFollowActivity = false;
                    }

                    isLoggedin = true;
                    if (User.Type == AccountType.Organization)
                    {
                        IsOrganization = true;
                    }
                    else
                    {
                        if (User.Followers < 300 && User.Followers > 0)
                        {
                            Followers = await UserUtility.GetAllFollowers(User.Login);
                        }

                        if (User.Following < 300 && User.Following > 0)
                        {
                            Following = await UserUtility.GetAllFollowing(User.Login);
                        }
                    }
                }
                else
                {
                    isLoggedin = false;
                }

                isLoading = false;
            }
        }
Exemplo n.º 4
0
        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;
                    }
                }
            }
        }
Exemplo n.º 5
0
        public async Task Load()
        {
            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 != null)
                {
                    if (GlobalHelper.NewFollowActivity)
                    {
                        User = await UserUtility.GetUserInfo(User.Login);

                        GlobalHelper.NewFollowActivity = false;
                    }

                    isLoggedin = true;
                    if (User.Type == AccountType.Organization)
                    {
                        IsOrganization = true;
                    }
                    else
                    {
                        Followers = await UserUtility.GetAllFollowers(User.Login);

                        Following = await UserUtility.GetAllFollowing(User.Login);
                    }
                }
                else
                {
                    isLoggedin = false;
                }

                isLoading = false;
            }
        }