ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapTool Class / ContextToolbarID Property
Example

In This Topic
    ContextToolbarID Property (MapTool)
    In This Topic
    Gets or sets the DAML ID of the toolbar to display for the tool.
    Syntax
    Protected Property ContextToolbarID As String
    protected string ContextToolbarID {get; set;}
    Example
    Set a MiniToolbar, ContextMenuID
    // daml entries
    // 
    // <menus>
    //  <menu id="MyMenu" caption="Nav">
    //    <button refID="esri_mapping_prevExtentButton"/>
    //    <button refID="esri_mapping_fixedZoomInButton"/>
    //  </menu>
    // </menus>
    // <miniToolbars>
    //   <miniToolbar id="MyMiniToolbar">
    //    <row>
    //      <button refID="esri_mapping_fixedZoomInButton"/>
    //      <button refID="esri_mapping_prevExtentButton"/>
    //    </row>
    //   </miniToolbar>
    // </miniToolbars>
    /// <summary>
    /// Represents a map sketch tool that provides a custom context menu and mini toolbar for user interactions.
    /// </summary>
    /// <remarks>This tool enables line sketching on the map and displays a context menu and mini toolbar, as
    /// specified by their respective DAML IDs, when activated. The context menu and toolbar can be customized to include
    /// commands relevant to the sketch workflow. The tool is configured to output line geometry directly to the map.
    /// <para> The <see cref="MapTool.ContextMenuID"/> and <see cref="MapTool.ContextToolbarID"/> properties are set to
    /// reference custom DAML menu and mini toolbar definitions. Ensure that the specified IDs correspond to valid DAML
    /// entries in your add-in configuration. </para></remarks>
    public class SketchToolWithToolbar : MapTool
    {
      public SketchToolWithToolbar()
      {
        IsSketchTool = true;
        SketchType = SketchGeometryType.Line;
        SketchOutputMode = SketchOutputMode.Map;
        ContextMenuID = "MyMenu";
        ContextToolbarID = "MyMiniToolbar";
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also