ObjectViewModel(object obj, MemberInfo info, ObjectViewModel parent) { _object = obj; _info = info; if (_object != null) { _type = obj.GetType(); if (!IsPrintableType(_type)) { // load the _children object with an empty collection to allow the + expander to be shown _children = new List <ObjectViewModel>(new ObjectViewModel[] { new ObjectViewModel(null) }); } } _parent = parent; }
public ObjectViewModelHierarchy(object rootObject) { _rootObject = new ObjectViewModel(rootObject); _firstGeneration = new ReadOnlyCollection <ObjectViewModel>(new ObjectViewModel[] { _rootObject }); }