private void cmdAddNewPage(string arg) { if (templateDesigner.template == null) return; Page page = new Page(); templateDesigner.AddPageDesignerForPage(page); templateDesigner.template.Pages.Add(page); }
public void AddPageDesignerForPage(Page page) { page.ScaleFactor = this.ActivePage != null ? this.ActivePage.page.ScaleFactor : 1f; PageDesigner pd = new PageDesigner(); pd.ClickToAdd = "None"; pd.OnElementAdded = this.OnElementAdded; pd.OnSelectedElementChanged = this.OnSelectedElementChanged; pd.OnSelectedElementMoved = this.OnSelectedElementMoved; pd.OnSelectedElementResized = this.OnSelectedElementResized; pd.page = page; pd.Width = Convert.ToInt32(page.Width * page.ScaleFactor); pd.Height = Convert.ToInt32(page.Height * page.ScaleFactor); flowLayoutPanel.Controls.Add(pd); this.ActivePage = pd; }