sure go ahead!
this is fine, and even what people do
class MyViewModel : ModelBase
{
public AModel MyProperty
{
get { return mProperty; }
set {
mProperty = value;
OnPropertyChanged();
}
}
public ObservableCollection<othermodel> Children { get; } = ObservableCollection<othermodel>
();
}</othermodel></othermodel>
In fact you do whatever you want!
The only one thing to remember is that these "ViewModels" are models for the views. As such their (only) constraint is the following: *
if a change must be reflected in the view, an INotifyPropertyChange
or INotifyCollectionChanged
(which ever appropriate) must be fired with it*.
It just happen that
class ObservableCollection<othermodel> : INotifyCollectionChanged</othermodel>