Hi Everyone,
I am trying to build a custom UI for a geoprocessing tool using DockPane.
I am populating a textbox or combo box using drag and drop functionality. By referring to the documents and sample I am able to access the feature class in the binding variable "TOCContent". I am unaware how can I access the attribute field of that particular feature class.
Any insights or guidance would be appreciated.
Below is the code copied from ESRI's sample (amended slightly).
public override void OnDrop(DropInfo dropInfo)
{
await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
if (dropInfo.HasTOCContent())
{
var layers = dropInfo.GetTOCContentOfType<FeatureLayer>();
FeatureLayer featureLayer =layers.FirstOrDefault();
// TOCContent = featureLayer.GetPath().ToString();
TOCContent = featureLayer;
var featureclass = featureLayer.GetFeatureClass();
var field = featureclass.GetDefinition().GetFields();
TableContent= field.findfield();
}
}
Data binding implementation:
private string _tocContentInfo = "Drag and drop from TOC";
public string TOCContent
{
get { return _tocContentInfo; }
set
{
SetProperty(ref _tocContentInfo, value, () => TOCContent);
}
}Below is a screenshot of my goal.
Thanks,
Abhijeet
