Parameters
- mapFrame
- MapFrame
| Exception | Description |
|---|---|
| ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
{
//Update a map surround.
//Note: Must be on QueuedTask.Run
// Reference and load the layout associated with the layout item
// Reference a scale bar element by name
MapSurround scaleBar = layout.FindElement("MyScaleBar") as MapSurround;
// Reference a map frame element by name
MapFrame mf = layout.FindElement("MyMapFrame") as MapFrame;
if ((scaleBar != null) && (mf != null))
//Set the scale bar to the newly referenced map frame
scaleBar.SetMapFrame(mf);
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)