Parameters
- page
- CIMPage
Return Value
Returns Layout or a null.
Exception | Description |
---|---|
ArcGIS.Core.CalledOnWrongThreadException | This method must be called within the lambda passed to QueuedTask.Run. |
//This example creates a new layout using a minimum set of parameters. //Added references using ArcGIS.Desktop.Layouts; using ArcGIS.Desktop.Framework.Threading.Tasks; using ArcGIS.Desktop.Core; public class CreateLayoutEx1 { async public static Task<Layout> CreateBasicLayout(double width, double height, LinearUnit units, string LayoutName) { Layout layout = null; await QueuedTask.Run(() => { layout = LayoutFactory.Instance.CreateLayout(width, height, units); layout.SetName(LayoutName); }); //Open the layout in a pane await ProApp.Panes.CreateLayoutPaneAsync(layout); return layout; } }
Target Platforms: Windows 10, Windows 8.1, Windows 7