It Looks like :
public MainWindow()
{
InitializeComponent();
List = new List<Person>();
List.Add(new Person("John", "xxx", 20));
List.Add(new Person("Dimitri", "yyy", 17));
LP.ItemsSource = List;
}
private void DoubleClick(object sender, MouseButtonEventArgs e)
{
Window1 win2 = new Window1();
win2.Show();
}
Class1:
class Person
{
public string Name { get; set; }
public string Surname { get; set; }
public int Age { get; set; }
public Person(string name,string surname,int age)
{
Name = name;
Surname = surname;
Age = age;
}
}
Class2:
class Person2
{
public DateTime Date { get; set; }
public string Place { get; set; }
public string Name2 { get; set; }
public Person2(DateTime date, string place, string name2)
{
Date = date;
Place = place;
Name2 = name2;
}
}
Second window:
public Window1(MainWindow mainwin1)
{
mainWindow = mainwin1;
Person2 c =new Person2(new DateTime(1997, 02, 03), "New York", "Bradley");
Person2 d = new Person2(new DateTime(1998, 03, 05), "Moscov", "Vladimir");
}
And all I need to know is how to do:
When I click on Dimitry in ListView in second window I will see content only of object d.
Same as John but object c.