private async void CheckInbox() { List <int> friendChanged = await Communications.FriendInbox(); foreach (int i in friendChanged) { //update database!!! if (i >= 0) { FriendEntity fe = await Communications.GetFriendEntity(i); Constants.Friend.Friends.Add(fe); View v = fe.GetView(); FriendList.Children.Add(v); } else { foreach (FriendEntity fe in Constants.Friend.Friends) { if (fe.FriendID == i) { Constants.Friend.Friends.Remove(fe); //undone } } //delete friend } } }
public void addNewFriendView(FriendEntity newfriend) { FriendList.Children.Add(newfriend.GetView()); }