예제 #1
0
        public override void SetupCustomUIElements(object ui)
        {
            var nodeUI = ui as dynNodeView;

            watchTree = new WatchTree();

            nodeUI.grid.Children.Add(watchTree);
            watchTree.SetValue(Grid.RowProperty, 2);
            watchTree.SetValue(Grid.ColumnSpanProperty, 3);
            watchTree.Margin = new Thickness(5, 0, 5, 5);

            if (Root == null)
            {
                Root = new WatchNode();
            }
            watchTree.DataContext = Root;

            this.RequestBindingUnhook += new EventHandler(delegate
            {
                BindingOperations.ClearAllBindings(watchTree.treeView1);
            });

            this.RequestBindingRehook += new EventHandler(delegate
            {
                var sourceBinding = new Binding("Children")
                {
                    Mode   = BindingMode.TwoWay,
                    Source = Root,
                };
                watchTree.treeView1.SetBinding(ItemsControl.ItemsSourceProperty, sourceBinding);
            });
        }
예제 #2
0
        public override void SetupCustomUIElements(dynNodeView nodeUI)
        {
            watchTree = new WatchTree();

            //nodeUI.inputGrid.Children.Add(watchTree);
            nodeUI.grid.Children.Add(watchTree);
            watchTree.SetValue(Grid.RowProperty, 2);
            watchTree.SetValue(Grid.ColumnSpanProperty, 3);
            watchTree.Margin = new Thickness(5, 0, 5, 5);
            watchTreeBranch  = watchTree.FindResource("Tree") as WatchTreeBranch;
        }