Relay command button ArcGIS Pro SDK Dockpane

130
3
2 weeks ago
AbhijeetNandeshwar1
New Contributor II

Hello Everyone,

I am trying to save/populate output of a raster file location in a textbox using a browse functionality button in Dockpane. However, I tried using the "show in file explorer" DAML ID reference "esri_file_openFileLocation" which is not working. Otherwise, if I tried using "esri_core_openProjectButton" it worked.

Can you please help me with the workflow or any suggestion?

Regards,

Abhijeet

 

 

 public static ICommand CmdOpenFileLocation
 {
     get
     {
         return new RelayCommand(() =>
         {
            // IPlugInWrapper wrapper = FrameworkApplication.GetPlugInWrapper("esri_file_openFileLocation");
             IPlugInWrapper wrapper = FrameworkApplication.GetPlugInWrapper("esri_core_openProjectButton");
             var command = wrapper as ICommand;
             if ((command != null) && command.CanExecute(null))
                 command.Execute(null);
         });
     }
 }

 

 

Browse button.png

3 Replies
GKmieliauskas
Esri Regular Contributor

Hi, 

There is no such id as "esri_file_openFileLocation". If you want to open ArcGIS Pro file "open" or "save" dialog, you can use OpenItemDialog or SaveItemDialog.

0 Kudos
AbhijeetNandeshwar1
New Contributor II

@ GKmieliauskas,

Thank you for sharing the information. I do appreciate your inputs. I have observe the list of DAML ids 

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

My query is if I am able to use "esri_core_openProjectButton" then why not  "esri_file_openFileLocation"

DAMLID.png

GKmieliauskas
Esri Regular Contributor

You use another id in your code sample: esri_file_openFileLocation. It is not esri_core_openFileLocation.

With esri_core_openFileLocation ICommand CanExecute with parameter null returns false. It means that you can't execute command. It could be that you need special type of object to pass as parameter for CanExecute and Execute.

0 Kudos