private void OnFriendListUpdateCallback(object sender, long steamId) { lock (m_friendLock) { //Friend is new to the list Friend newFriend = new Friend(m_Steam.Friends[steamId]); newFriend.PropertyChanged += FriendOnPropertyChanged; newFriend.IsVisible = ShouldShowFriend(newFriend); int index = Friends.FindIndex(f => f.SteamID == steamId); if (index == -1) { Friends.Add(newFriend); } else { Friends[index] = newFriend; } Friends = Friends.OrderBy(f => f.PersonaState == TinySteamWrapper.Steam.PersonaState.Offline).ThenBy(f => f.PersonaName).ToList(); RaisePropertyChangedEvent(nameof(Friends)); } }