private void buttonCall_Click(object sender, RoutedEventArgs e) { FriendData friend = ClientInformation.GetFriend(Partner); if (friend.Status) { CallingWindow callingWindow = new CallingWindow(friend.Username, friend.AvatarImage, false); ClientInformation.CallingWindows.Add(friend.Username, callingWindow); callingWindow.Show(); } }
private void buttonCall_Click(object sender, RoutedEventArgs e) { if (Partners.Count != 0) { CallingWindow callingWindow = new CallingWindow(GroupName, null, true); if (!ClientInformation.CallingWindows.ToList().Exists(x => x.Key == GroupName)) { ClientInformation.CallingWindows.Add(GroupName, callingWindow); callingWindow.Show(); } else { KeyValuePair <string, CallingWindow> pair = ClientInformation.CallingWindows.ToList().Find(x => x.Key == GroupName); pair.Value.Show(); } } }