I have a simple example where I\'m creating a View consisting of a list box, and the list box displays a bunch of items. I\'m wondering if I\'m going about the creation of t
You are on the right track.
The parent model would naturally contain a list of child models, e.g. a customer having multiple orders.
When ParentViewModel
is created and loaded by a third-party, it is passed a ParentModel
. Then the ParentViewModel
will:
ParentModel
to a local variable ChildViewModel
for each ChildModel
by passing the
ChildModel
to the ChildViewModel
constructor ChildViewModels
to a listBy the way, you want
public List<ChildViewModel> ChildViewModels { get; set; }
to be
public ObservableCollection<ChildViewModel> ChildViewModels { get; set; }