Exemple #1
0
            public static TreeModel GetModel()
            {
                TreeModel treeModel = new TreeModel();

                TreeItemModel treeItemModel = new TreeItemModel(treeModel)
                {
                    Id       = 1,
                    Name     = "Root folder",
                    ParentId = null
                };

                treeModel.Add(treeItemModel);

                treeItemModel = new TreeItemModel(treeModel)
                {
                    Id       = 2,
                    Name     = "Level 0 folder",
                    ParentId = 1
                };

                treeModel.Add(treeItemModel);

                treeItemModel = new TreeItemModel(treeModel)
                {
                    Id       = 3,
                    Name     = "Level 1 element",
                    ParentId = 2
                };

                treeModel.Add(treeItemModel);

                return(treeModel);
            }