private void UserCard_UserControlFullClicked(object sender, RoutedEventArgs e) { UserCard userCard = ((UserCard)sender); foreach (var item in users) { if (item.Name == userCard.User_Name.Text && item.LastName == userCard.User_LastName.Text) { UserFull userFull = new UserFull(); userFull.Title = item.Name + " " + item.LastName + ", Город: " + item.City; userFull.User_Card.User_Name.Text = item.Name; userFull.User_Card.User_LastName.Text = item.LastName; userFull.User_Card.user_city.Text += item.City; userFull.User_Card.user_country.Text += item.Country; userFull.User_Card.text_distance.Text = userCard.User_Kilometer.Text; if (!string.IsNullOrEmpty(item.Description)) { userFull.User_Card.user_description.Text = item.Description; } userFull.User_Card.User_Age.Text = GetAge(item.Birthday).ToString(); var hobbies = client.GetHobbies(item); if (hobbies != null) { if (hobbies.Count() > 0) { foreach (var hobbie in hobbies) { InterestedBox interestedBox = new InterestedBox(); interestedBox.textBlock_Hobbies.Text = hobbie.Hobbie; userFull.User_Card.user_hobbies.Children.Add(interestedBox); } } } userFull.ShowDialog(); } } }