internal void AddDescendingControl(ContentControl control) { descendingControls.Add(control); if (TemplateDocument != null && TemplateDocument.AllContentControls.Contains(control) == false) { TemplateDocument.AddControl(control, false); } }
public ContentControl Clone() { if (!(SdtElement.CloneNode(true) is SdtElement clonedElement)) { return(null); } SdtElement.InsertBeforeSelf(clonedElement); var cloned = new ContentControl(clonedElement, IsDescendantOfAContentControl, TemplateDocument); TemplateDocument.AddControl(cloned, IsFirstOrder); cloned.GenerateDescendantsFromChildren(); cloned.Parent = Parent; return(cloned); }