I'm looking to create my own custom menu from a button drop down like the "Download Map" on the standard Pro Map tab:
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?
Solved! Go to Solution.
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.
XAML:
DAML:
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
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 🙂
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.
XAML:
DAML:
Ahh, seems straight forward now. Appreciate it!
Checkbox issue might be frustrating, I'll play with it.
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
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!
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.
My Project - https://ntpropertycare.com/high-rise-window-cleaning/