示例#1
0
 protected override void OnAppearing()
 {
     base.OnAppearing();
     FriendsListView.BeginRefresh();
     VM.InitialUser();
     FriendsListView.EndRefresh();
 }
示例#2
0
        protected override async void OnAppearing()
        {
            UserSearchBar.IsEnabled = false;
            FriendsListView.BeginRefresh();
            var Temp = await VM.OnAppearing();

            if (Temp.Count != 0)
            {
                ListVisble();
                FriendsListView.ItemsSource = Temp;
            }
            else
            {
                ResultLbl.Text = "Friend list is empty.";
                ResultLblVisibleOnly();
            }
            UserSearchBar.IsEnabled = true;
            FriendsListView.EndRefresh();
        }
示例#3
0
        private async void FriendsListView_ItemTapped(object sender, ItemTappedEventArgs e)
        {
            if (ClickedBtn == true)
            {
                FriendsListView.BeginRefresh();
                await VM.AddFriendToFriendsListAsync((User)e.Item);

                FriendsListView.EndRefresh();
                RefreshList();
                ClickedBtn = false;
            }
            else
            {
                FriendsListView.BeginRefresh();
                await VM.SearchIndividualChatRoom((User)e.Item);

                FriendsListView.EndRefresh();
            }
        }
示例#4
0
        private void UserSearchBar_TextChanged(object sender, TextChangedEventArgs e)
        {
            string InputEmail = e.NewTextValue;

            FriendsListView.BeginRefresh();
            if (InputEmail != UserSetting.UserEmail)
            {
                if (!string.IsNullOrWhiteSpace(InputEmail))
                {
                    if (CountData(e.NewTextValue) != 0)
                    {
                        ListVisble();
                        FriendsListView.ItemsSource = VM.FriendsList.Where(i => i.Email.ToLower().Contains(InputEmail.ToLower()));
                    }
                    else
                    {
                        ListInvisible();
                        ResultLbl.Text     = "User not in your friends list.";
                        SearchUserBtn.Text = "Search New User \"" + InputEmail + "\"";
                    }
                }
                else
                {
                    if (VM.FriendsList.Count != 0)
                    {
                        ListVisble();
                        FriendsListView.ItemsSource = VM.FriendsList;
                    }
                    else
                    {
                        ResultLbl.Text = "Friend list is empty.";
                        ResultLblVisibleOnly();
                    }
                }
            }
            else
            {
                ResultLblVisibleOnly();
                ResultLbl.Text = "Hi," + UserSetting.UserName;
            }
            FriendsListView.EndRefresh();
        }