I have a class structure as follows :
public class Person
{
public PersonInfo Details { get; set; }
public string Name { get; set; }
}
public class PersonInfo
{
public string Designation { get; set; }
}
I am trying bind 2 textBoxes as follows:
Person person = new Person();
textBox1.DataContext = person;
textBox2.DataContext = person;
Binding textBox1Binding = new Binding()
{
Mode = BindingMode.OneWayToSource,
Path = new PropertyPath("Name"),
};
Binding textBox1Binding = new Binding()
{
Mode = BindingMode.OneWayToSource,
**Path = new PropertyPath("Details.Designation")** << problem is here
};
How to bind "Details.Designation" to textbox2 ?
Any help would be appreciated.