private void FriendRemoved(FriendStatus friendStatus)
 {
     PgUser friendUiData;
     if (_userData.TryGetFriend(friendStatus._id, out friendUiData))
         _userData.RemoveFriend(friendUiData);
 }
 private void FriendStatusChanged(FriendStatus friendStatus)
 {
     PgUser friendData;
     if (_userData.TryGetFriend(friendStatus._id, out friendData))
     {
         friendData.Status = friendStatus.status;
         RefreshFriendsGrid();
     }
 }
        private void FriendAdded(FriendStatus friendStatus)
        {
            UserWithStatus friend = new UserWithStatus();
            friend._id = friendStatus._id;
            friend.username = friendStatus.username;
            friend.status = FriendStatusOffline;
            AddOrUpdateFriend(friend, friendStatus.lobbies);

            var todoList = new List<UIElement>();
            foreach (var item in stackPanelFriendRequestsFrom.Children)
            {
                var request = item as FriendRequestFromUserControl;
                if (request == null)
                    continue;
                if (request.Username == friendStatus.username)
                    todoList.Add((UIElement)item);
            }
            foreach (var item in todoList)
                stackPanelFriendRequestsFrom.Children.Remove(item);
        }