private static void UnGroupSizableElement(IElement ele, ILayoutHost host) { if (ele == null) { return; } ISizableElementGroup group = host.LayoutRuntime.Layout.FindParent(ele) as ISizableElementGroup; if (group == null) { return; //选中的元素没有被组合 } UnGroupSizableGroup(group, host); }
private static void UnGroupSizableGroup(ISizableElementGroup group, ILayoutHost host) { if (group == null) { return; } List <IElement> eles = group.Elements; IElementGroup parent = host.LayoutRuntime.Layout.FindParent(group) as IElementGroup; if (parent == null) { return; } foreach (IElement e in eles) { parent.Elements.Add(e); } parent.Elements.Remove(group); }