Ejemplo n.º 1
0
        public void ExtensionMethods()
        {
            System.Windows.Controls.TreeView tv =
                new System.Windows.Controls.TreeView();

            TreeModel <string> tm = new TreeModel <string>("",
                                                           new List <TreeModel <string> >()
            {
                new TreeModel <string>("section 1",
                                       new List <TreeModel <string> >()
                {
                    new TreeModel <string>("sec1item1"),
                    new TreeModel <string>("sec1item2")
                }),
                new TreeModel <string>("section 2"),
            });

            tv.RestoreFromTreeModel(tm);

            TreeModel <string> result = tv.SaveToTreeModel("");

            Assert.AreEqual(tm, result);
        }