Parameters
- page
- CIMPage
Exception | Description |
---|---|
ArcGIS.Core.CalledOnWrongThreadException | This method must be called within the lambda passed to QueuedTask.Run. |
//Modify a layouts page settings. //Perform on the worker thread await QueuedTask.Run(() => { CIMPage page = layout.GetPage(); //Do something layout.SetPage(page); });
//Change the layout page size. //Reference the layout project item LayoutProjectItem lytItem = Project.Current.GetItems<LayoutProjectItem>() .FirstOrDefault(item => item.Name.Equals("MyLayout")); if (layoutItem != null) { await QueuedTask.Run(() => { //Get the layout Layout lyt = lytItem.GetLayout(); if (lyt != null) { //Change properties CIMPage page = lyt.GetPage(); page.Width = 8.5; page.Height = 11; //Apply the changes to the layout lyt.SetPage(page); } }); }
Target Platforms: Windows 11, Windows 10