protected override void OnAppearing() { base.OnAppearing(); FriendsListView.BeginRefresh(); VM.InitialUser(); FriendsListView.EndRefresh(); }
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(); }
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(); } }
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(); }