I have a custom plugin datasource and I want the user to be able to update and repair the data source on their tables using my custom plugin datasource. Unfortunately, since ArcGIS Pro doesn't know how to read my datasource file, nothing shows up in the data source selection window. In the screenshot below, you can see the current data source is the .bsc file plus the views.3 but when I click "Set Data Source..." and navigate to the bsc file in the window, the container is empty. Is it possible to write code that will read my custom bsc file to allow the user to select their data source?
Solved! Go to Solution.
The Set Data Source button on the Layer PropertySheet page can’t be used to browse to your custom bsc file (plugin data).
Instead, you will have to make a custom property page that you can insert into Pro’s Layer Property Sheet. (The daml id for this is esri_mapping_featureLayerPropertySheet)
<propertySheets>
<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>
On this custom page, you can have a button that displays a OpenItemDialog. Set the filter in this dialog to open your bsc files.
Then, you can fix the data source on your layer to the selected bsc file by accessing its data connection via the CIM.
The Set Data Source button on the Layer PropertySheet page can’t be used to browse to your custom bsc file (plugin data).
Instead, you will have to make a custom property page that you can insert into Pro’s Layer Property Sheet. (The daml id for this is esri_mapping_featureLayerPropertySheet)
<propertySheets>
<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>
On this custom page, you can have a button that displays a OpenItemDialog. Set the filter in this dialog to open your bsc files.
Then, you can fix the data source on your layer to the selected bsc file by accessing its data connection via the CIM.