/* public double ChildrenWidth { get { double cw = 0; double sep = 0; foreach (TreeNodeGraphics tg in Children) { cw += tg.ActualWidth + sep; sep = 10; } return cw; } } */ public TreeNodeGraphics(Core.Types.TreeBase t) : base(GraphicsElementFactory.Produce(t.Value)) { tree = t; tree.ValueInitialized += treeValueInitialized; _children = new List<TreeNodeGraphics>(); isWidthInvalidated = true; // if (tree.Value != null) // tree.Value.Changed += tree_ValueChanged; // tree.Changed += tree_ValueChanged; }
public TreeGraphics(Core.Types.TreeBase t) { tree = t; canvas = new Canvas(); canvas.SnapsToDevicePixels = false; this.SnapsToDevicePixels = false; SnapsToDevicePixels = false; Border b = new Border(); b.BorderBrush = Brushes.Black; canvas.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; canvas.VerticalAlignment = System.Windows.VerticalAlignment.Top; HorizontalContentAlignment = System.Windows.HorizontalAlignment.Stretch; VerticalContentAlignment = System.Windows.VerticalAlignment.Stretch; b.Child = canvas; Content = b; Update(); tree.Changed += tree_Changed; }