public ViewModel(core2.Project project, core2.Table table, double basePercent, ItemCollection display)
 {
     this.table        = table;
     this.project      = project;
     this._basePercent = basePercent;
     nodes             = new List <ViewModelTreeNode>();
     this.displayNodes = display;
 }
        private Button creatButtonForTable(core2.Table table)
        {
            Button button = new Button();

            button.Name    = table.Name;
            button.Content = table.Name;
            button.Click  += (obj, e) => { SetTable(button.Name); };
            return(button);
        }
        protected void setTableRaw(core2.Table table)
        {
            projectTree.Items.Clear();
            if (viewModel != null)
            {
                viewModel.Clear();
            }

            if (table != null)
            {
                viewModel = new ViewModel(project, table, 1.0, projectTree.Items);
                viewModel.Dispay();
            }
        }
            public ViewModelChild(ViewModel model, Parent parent, core2.Table table)
            {
                this.table  = table;
                nodes       = new List <ViewModelTreeNodeChild>();
                this.parent = parent;
                this.model  = model;


                Label label = new Label();

                label.Content = table.Name;
                TreeView tree = new TreeView();

                displayNodes = tree.Items;

                stackPanel = new StackPanel();
                stackPanel.Children.Add(label);
                stackPanel.Children.Add(tree);
            }
        public void SetTable(string name)
        {
            core2.Table table = project.GetTable(name);

            setTableRaw(table);
        }