ProSnippets DAML - Esri/arcgis-pro-sdk GitHub Wiki

All ProSnippets listed here are also used by the following sample code: DAML sample code

Language:              C#  
Subject:               Framework  
Contributor:           ArcGIS Pro SDK Team <[email protected]>  
Organization:          esri, http://www.esri.com  
Date:                  10/22/2024  
ArcGIS Pro:            3.4  
Visual Studio:         2022  
.NET Target Framework: .Net 8  

DAML

Panes: Reset Panes

<DockPaneSets>
  <insertDockPaneSet id="esri_DockPaneReset_bookmarks" caption="Reset pane for Bookmarks">
    <DockPaneID refID="esri_mapping_showBookmarksWindow" />
    <DockPaneID refID="esri_core_contentsDockPane" />
  </insertDockPaneSet>
</DockPaneSets>

Button: Removing a core button from the ribbon

Note: "updateModule" tag should be within the "modules" tag

<updateModule refID="esri_mapping">
  <groups>
    <updateGroup refID="esri_mapping_navigateGroup">
      <deleteButton refID="esri_mapping_bookmarksNavigateGallery"></deleteButton>
    </updateGroup>
  </groups>
</updateModule>

Button: Insert new button into an existing group on the ribbon

Note: "updateModule" tag should be within the "modules" tag

<updateModule refID="esri_mapping">
  <groups>
    <updateGroup refID="esri_mapping_navigateGroup">
      <insertButton refID="New_Menu_Item_Button" />
    </updateGroup>
  </groups>
</updateModule>

Menu: Insert a new button to the Layer context menu

Note: "updateModule" tag should be within the "modules" tag

<updateModule refID="esri_mapping">
  <menus>
    <updateMenu refID="esri_mapping_layerContextMenu">
      <!--Note: New_Menu_Item_Button is a button control that must exist within the controls tag-->
      <insertButton refID="New_Menu_Item_Button" placeWith="esri_mapping_selectedLayerSymbologyButton" />
    </updateMenu>
  </menus>
</updateModule>

Menu: Insert a new Menu to the Map Container context menu

Note: "updateModule" tag should be within the "modules" tag

<updateModule refID="esri_mapping">
  <menus>
    <updateMenu refID="esri_mapping_mapContainerContextMenu">
      <!--Note: New_Menu_Item_Button is a button control that must exist within the controls tag-->
      <insertMenu refID="DAML_Menu_New_Menu" placeWith="esri_core_editPasteButton" />
    </updateMenu>
  </menus>
</updateModule>

Menu: Insert a new button to the 2D Map context menu

Note: "updateModule" tag should be within the "modules" tag

<updateModule refID="esri_mapping">
  <menus>
    <updateMenu refID="esri_mapping_mapContextMenu">
      <!--Note: New_Menu_Item_Button is a button control that must exist within the controls tag-->
      <insertButton refID="New_Menu_Item_Button" placeWith="esri_mapping_addDataButton" />
    </updateMenu>
  </menus>
</updateModule>

Menu: Insert a new button to the Scene context menu

Note: "updateModule" tag should be within the "modules" tag

<updateModule refID="esri_mapping">
  <menus>
    <updateMenu refID="esri_mapping_3d_mapContextMenu">
      <!--Note: New_Menu_Item_Button is a button control that must exist within the controls tag-->
      <insertButton refID="New_Menu_Item_Button" placeWith="esri_mapping_addDataButton" separator="true" />
    </updateMenu>
  </menus>
</updateModule>

Menu: Insert a new button to the Map Content context menu

Note: "updateModule" tag should be within the "modules" tag

<updateModule refID="esri_mapping">
  <menus>
    <updateMenu refID="esri_mapping_map2DContextMenu">
      <!--Note: New_Menu_Item_Button is a button control that must exist within the controls tag-->
      <insertButton refID="New_Menu_Item_Button" placeWith="esri_core_rename" />
    </updateMenu>
  </menus>
</updateModule>

Menu: Insert a new button to the Scene Content context menu

Note: "updateModule" tag should be within the "modules" tag

<updateModule refID="esri_mapping">
  <menus>
    <updateMenu refID="esri_mapping_map3DContextMenu">
      <!--Note: New_Menu_Item_Button is a button control that must exist within the controls tag-->
      <insertButton refID="New_Menu_Item_Button" placeWith="esri_core_rename" separator="true" />
    </updateMenu>
  </menus>
</updateModule>

Menu: Inserts a new button to the context menu for a group layer.

Note: "updateModule" tag should be within the "modules" tag

<updateModule refID="esri_mapping">
  <menus>
    <updateMenu refID="esri_mapping_groupLayerContextMenu">
      <insertButton refID="DAML_Menu_Custom_menus_ContextButton" placeWith="esri_mapping_selectedLayerPropertiesButton" insert="after" />
    </updateMenu>
  </menus>
</updateModule>

SplitButton: Inserts a new button to the Add Data split button

Note: "updateModule" tag should be within the "modules" tag

<updateModule refID="esri_mapping">
    <splitButtons>
        <updateSplitButton refID="esri_mapping_addDataSplitButton">
            <insertButton refID="EsriCommunity_MyAddData" />
        </updateSplitButton>
    </splitButtons>
</updateModule>

Subgroup: Insert and delete subgroups within a group.

Note: "updateModule" tag should be within the "modules" tag

<updateModule refID="esri_mapping">
  <groups>
    <updateGroup refID="esri_mapping_layerGroup">
      <insertSubgroup refID="esri_mapping_enableAnimation_subGroup" />
      <deleteSubgroup refID="esri_mapping_firstLayerSubGroup" />
    </updateGroup>
  </groups>
</updateModule>

Subgroup: Insert and delete within a subgroup

Note: "updateModule" tag should be within the "modules" tag

<updateModule refID="esri_mapping">
  <subgroups>
    <updateSubgroup refID="esri_mapping_firstLayerSubGroup">
      <deleteGallery refID="esri_mapping_basemapGallery" />
      <insertButtonPalette refID="esri_mapping_firstLayerSubGroup" />
    </updateSubgroup>
  </subgroups>
</updateModule>

Backstage tab: Delete Pro's tabs and insert your own tab

Note: The "backstage" tag comes after the closing "modules" tag

<backstage>
  <!--Deletes the New Project tab in Pro's backstage-->
  <deleteTab refID="esri_core_newProjectBackStageTab" />
  <!--Deletes the Open Project tab in Pro's backstage-->
  <deleteTab refID="esri_core_openProjectBackStageTab" />
  <!--Inserts a new tab into Pro's backstage, placed before the Save Project tab-->
  <insertTab id="GeocodeBackstageTab" caption="Geocode" className="DAML.Backstage.GeocodeBackstageTabViewModel" insert="before" placeWith="esri_core_saveProjectButton" keytip="Z7">
    <content className="DAML.Backstage.GeocodeBackstageTabView" />
  </insertTab>
</backstage>

PropertySheet: Insert Property Page into the Options Dialog Property sheet

Note: The "propertySheets" tag comes after the closing "modules" tag.

<propertySheets>
  <!--refID is set to the DAML Id of Pro's Options property sheet-->
  <updateSheet refID="esri_core_optionsPropertySheet">
    <insertPage id="ModifyProUIWithDAML_OptionsPropertySheet_OptionsDialogPropertyPage" caption="Sample Project Settings" className="DAML.OptionsPropertySheet.OptionsDialogPropertyPageViewModel" group="Project">
      <!--Setting "groups" attribute to "Project" will add 
                page to the Project group on the Pro options dialog.-->
      <content className="DAML.OptionsPropertySheet.OptionsDialogPropertyPageView" />
    </insertPage>
  </updateSheet>

PropertySheet: Insert Property Page into the Layer Properties Property sheet

<updateSheet refID="esri_mapping_featureLayerPropertySheet">
    <insertPage id="DAML_LayersPropertySheet_LayersPropertySheet" caption="My custom layer properties" className="DAML.LayersPropertySheet.LayersPropertySheetViewModel" placeWith="esri_mapping_layerSourcePropertyPage" insert="after" >
        <content className="DAML.LayersPropertySheet.LayersPropertySheetView" />
    </insertPage>
</updateSheet>
⚠️ **GitHub.com Fallback** ⚠️