public override ModelTreeNode AddItem() { var item = new IncludeModel(); //should be typed to something more specific var node = new IncludeTreeNode <TModel, TNode>() { Model = item }; node.AddDefaultChildNodesHack(); Nodes.Add(node); return(node); }
public override void AddChildModel(IModel model) { var incModel = (IncludeModel)model; var childModels = incModel.Load <TModel>(); var node = new IncludeTreeNode <TModel, TNode>() { Model = model }; node.AddDefaultChildNodesHack(); node.AddChildModels(childModels.Cast <IModel>().ToList()); //add to tree Nodes.Add(node); }