Relay command button ArcGIS Pro SDK Dockpane

366
5
Jump to solution
02-12-2024 06:18 AM
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

1 Solution

Accepted Solutions
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.

View solution in original post

5 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.

AbhijeetNandeshwar1
New Contributor II

Thanks!

 

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
AbhijeetNandeshwar1
New Contributor II

Thank you for your response @GKmieliauskas . If you notice I have commented out the line No 7 which is esri_file_openFileLocation. 

As I am in my learning phase of this technology, Can you please help me with the command for CanExecute and Execute in order to execute the esri_core_openFileLocation?

Any article or document is highly appreciated.

Regards,

Abhijeet

0 Kudos