Ejemplo n.º 1
0
        private ObjectViewModel(object obj, FieldInfo info, ObjectViewModel parent, int?index = null)
        {
            _object = obj;
            _info   = info;
            _index  = index;

            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 ReadOnlyCollection <ObjectViewModel>(new ObjectViewModel[] { new ObjectViewModel(null) });
                }
            }
            _parent = parent;
        }
 public ObjectViewModelHierarchy(object rootObject)
 {
     _rootObject      = new ObjectViewModel(rootObject);
     _firstGeneration = new ReadOnlyCollection <ObjectViewModel>(new ObjectViewModel[] { _rootObject });
 }