private void c_UsersReceived(object sender, UsersReceivedEventArgs e) { string selectedName = string.Empty; if (lbUsers.SelectedItems.Count > 0) { selectedName = ((LoggedinUserClient)lbUsers.SelectedItems[0]).Name; } //----------------------- lista feltöltése List <LoggedinUserClient> ul = (from item in e.users1 select new LoggedinUserClient { Name = item.Name, ImageSource = item.Sex == 1 ? malepic.Source : femalepic.Source }).ToList(); //lbUsers.ItemsSource = null; lbUsers.ItemsSource = ul; //-------------------------------- if (selectedName != string.Empty) { SelectMarkedUser(selectedName, ul); } RemoveInvalidUsersFromRequests(); }
void c_UsersReceived(object sender, UsersReceivedEventArgs e) { List <string> u = e.users1.ToList(); lbUsers.Items.Clear(); foreach (string item in u) { lbUsers.Items.Add(item); } }
private void OnUsersReceived(object sender, UsersReceivedEventArgs e) { UsersReceived?.Invoke(this, e); }