private void SentTabItem_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (SentDataGrid.SelectedIndex == -1) return; Guid selUserID = (SentDataGrid.SelectedValue as Post).UserId; Users selUser = (from q in forumEntities.Users where q.UserId == selUserID select q).First(); ShowUserProfile UserProfile = new ShowUserProfile(UserLogined, selUser, forumEntities, DB); UserProfile.ShowDialog(); FillSent(); }