/// <summary> /// Default ctor /// </summary> public TextViewNodeControl(TextViewNode node, IXmlLayoutDesigner rootDesigner) { this.node = node; this.rootDesigner = rootDesigner; node.PropertyChanged += (s, x) => UpdateFromNode(); UpdateFromNode(); MouseLeftButtonUp += (s, x) => rootDesigner.Select(this); }
/// <summary> /// Default ctor /// </summary> public LinearLayoutControl(LinearLayoutNode node, IXmlLayoutDesigner rootDesigner) { this.node = node; this.rootDesigner = rootDesigner; node.PropertyChanged += (s, x) => UpdateFromNode(); ViewGroupChildConnector.Connect(node, this, rootDesigner); UpdateFromNode(); }
/// <summary> /// Default ctor /// </summary> private ViewGroupChildConnector(ViewGroupNode node, IViewGroupNodeControl control, IXmlLayoutDesigner rootDesigner) { this.node = node; this.control = control; this.rootDesigner = rootDesigner; // Add controls for all children now foreach (var childNode in node.Children) { var childControl = childNode.Accept(ControlBuilder.Instance, rootDesigner); control.Add(childControl); } }
public static void Connect(ViewGroupNode node, IViewGroupNodeControl control, IXmlLayoutDesigner rootDesigner) { var connector = new ViewGroupChildConnector(node, control, rootDesigner); node.Children.CollectionChanged += connector.OnChildrenChanged; }