I have a
ObservableCollection<CustomObj> DataInfo
in my MVVM WPF project. The CustomObj class look like this:
public class class1 : ObservableObject
{
public class1()
{
MySecondProperty = new Class2();
}
public string MyStringValue { get; set; }
public Class2 MySecondProperty { get; set; }
public List<Class3> MyThirdProperty{ get; set; }
}
When ever I bind the WPF property like this
<DataGrid Name="dgMyDataGrid"
SelectedItem="{Binding SelectedItem}"
ItemsSource="{Binding DataInfo}">
</DataGrid>
I get the value from "MyStringValue", and object and a collection in my datagrid. Google gives me no result and I can't find anything similar to this example.
How can I get my data from Class2 and from the List in a easy way to show the data?