Пример #1
0
 public TreeNodeVM(TreeNode node, TreeNodeVM parent = null)
 {
     Node     = node;
     Value    = node.Value;
     Parent   = parent;
     Children = new ObservableCollection <TreeNodeVM>();
     foreach (TreeNode child in node.Children)
     {
         Children.Add(new TreeNodeVM(child, this));
     }
     Children.CollectionChanged += Children_CollectionChanged;
 }
Пример #2
0
        private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TreeNodeVM vm = d as TreeNodeVM;

            vm.Node.Value = (int)e.NewValue;
        }