Custom Ribbon Button Drop Down in Add-in

1808
8
Jump to solution
02-26-2021 02:23 PM
JoeMadrigal
New Contributor III

I'm looking to create my own custom menu from a button drop down like the "Download Map" on the standard Pro Map tab:

JoeMadrigal_0-1614377784122.png

Is there a way to do this in the Pro SDK?  Perhaps using a supplied XAML template inside a button splitter or palette control?  I looked through the samples and don't seem to find anything. Maybe its not possible?

 

 

0 Kudos
1 Solution

Accepted Solutions
KirkKuykendall1
Occasional Contributor III

Yeah, the documentation is pretty sparse.  This works for me, but when I check/uncheck the checkbox on my control, it closes.  With Esri's download map control, it stays open when do the same. 

KirkKuykendall1_0-1614388096812.png

XAML:

KirkKuykendall1_1-1614388181715.png

DAML:

KirkKuykendall1_2-1614388256318.png

 

 

View solution in original post

0 Kudos
8 Replies
KirkKuykendall1
Occasional Contributor III

Did you try putting a CustomControl inside a SplitButton?

See page 6 here: 

https://proceedings.esri.com/library/userconf/devsummit-euro16/papers/devsummit-euro_30.pdf

0 Kudos
JoeMadrigal
New Contributor III

Haven't tried that yet since there is little documentation on custom controls that I can see.  I just added the custom control to my project now.  I just have to figure out how to add it to the split button (I assume in place of any of the buttons perhaps?).  Thanks for the presentation.  Just wish I can see their demos for the details 🙂

0 Kudos
KirkKuykendall1
Occasional Contributor III

Yeah, the documentation is pretty sparse.  This works for me, but when I check/uncheck the checkbox on my control, it closes.  With Esri's download map control, it stays open when do the same. 

KirkKuykendall1_0-1614388096812.png

XAML:

KirkKuykendall1_1-1614388181715.png

DAML:

KirkKuykendall1_2-1614388256318.png

 

 

0 Kudos
JoeMadrigal
New Contributor III

Ahh, seems straight forward now.  Appreciate it!

0 Kudos
JoeMadrigal
New Contributor III

Checkbox issue might be frustrating, I'll play with it.

0 Kudos
CharlesMacleod
Esri Regular Contributor

looking in the ADMapping.daml I see this:

<customControl id="esri_mapping_downloadMap" caption="Download Map" className="ArcGIS.Desktop.Internal.Mapping.Ribbon.DownloadMap" disableIfBusy="true" showHelp="true" staysOpenOnClick="true" isDropDown="true"
                      ...>
          <content className="ArcGIS.Desktop.Internal.Mapping.Ribbon.DownloadMapControl" />
          ...
</customControl>

 

Note the staysOpenOnClick and IsDropDown attributes. I think those are what you are after.

You can find the ADMapping.daml here: <your Pro install location>/bin/Extensions/Mapping

and here: https://github.com/Esri/arcgis-pro-sdk/wiki/DAML-ID-Reference-ADMapping.daml 

JoeMadrigal
New Contributor III

Ok, this is what I learned.  If I host the custom control via splitbutton, then the staysOpenOnClick has no affect.  If I put the custom control directly in the tab group, then it works as long as you also set the isDropDown to true.  Thanks @CharlesMacleod  for the hint and link.  This is exactly what they are doing in the download map custom control!

danielkebbe
New Contributor

This works for me as well, but when I check/uncheck the checkbox on my control, it closes.  With Esri's download map control, it stays open when do the same. If I put the custom control directly in the tab group, then it works as long as you also set the isDropDown to true.

0 Kudos