protected virtual bool IsComponentActive(UIComponentRoot root, string id) { var stack = new Stack <UIComponentConfiguration>(); stack.Push(root.Component); while (stack.Count > 0) { var component = stack.Pop(); if (component == null) { continue; } if (string.Equals(component.Component, id, StringComparison.OrdinalIgnoreCase)) { return(true); } if (component.Children != null) { foreach (var child in component.Children) { stack.Push(child); } } } return(false); }
protected virtual void ShowDesignerOverlay(UIComponentRoot root) { var designerOverlay = new UIComponentDesignerOverlay(root); designerOverlay.InitializeComponent(this.Core); this.Overlays.Add(designerOverlay); }
protected static void OnActiveChanged(UIComponentRoot sender) { if (ActiveChanged == null) { return; } ActiveChanged(sender, EventArgs.Empty); }
public override UIComponentBase Load(UILayoutTemplate template) { switch (template) { case UILayoutTemplate.Main: var root = new UIComponentRoot(); root.SetBinding( UIComponentPanel.ComponentProperty, new Binding() { Source = this, Path = new PropertyPath("MainComponent") } ); return(root); } throw new NotImplementedException(); }
public UIComponentDesignerOverlay(UIComponentRoot root) { this.Root = root; }