ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Core Namespace / LayoutOptions Class / WarnAboutAssociatedSurrounds Property
Example

In This Topic
    WarnAboutAssociatedSurrounds Property
    In This Topic
    Gets and sets whether a warning will be shown when deleting a map frame will result in other elements in the layout being deleted.
    Syntax
    public bool WarnAboutAssociatedSurrounds {get; set;}
    Public Property WarnAboutAssociatedSurrounds As Boolean
    Example
    Get LayoutOptions
    var lastToolActive = ApplicationOptions.LayoutOptions.KeepLastToolActive;
    var warnOnSurrounds = ApplicationOptions.LayoutOptions.WarnAboutAssociatedSurrounds;
    //eg <Install_Path>\Resources\LayoutTemplates\en-US
    var gallery_path = ApplicationOptions.LayoutOptions.LayoutTemplatePath;
    var defaultGuideColor = ApplicationOptions.LayoutOptions.DefaultGuideColor;
    QueuedTask.Run(() =>
    {
      var guideColor = ApplicationOptions.LayoutOptions.GetGuideColor();
    });
    Set LayoutOptions
    //keep graphic element insert tool active
    ApplicationOptions.LayoutOptions.KeepLastToolActive = true;
    //no warning when deleting a map frame results in other elements being deleted
    ApplicationOptions.LayoutOptions.WarnAboutAssociatedSurrounds = false;
    //path to .pagx files used as templates
    ApplicationOptions.LayoutOptions.LayoutTemplatePath = @"D:\data\layout_templates";
    
    QueuedTask.Run(() =>
    {
      var guideColor = ApplicationOptions.LayoutOptions.GetGuideColor();
      // set guide color
      ApplicationOptions.LayoutOptions.SetGuideColor(ColorFactory.Instance.RedRGB);
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also