Hi,
In ArcGIS Pro, I have two layer files that only contain symbology. When we manually set the source by right-clicking a layer, the layer properties window opens, and we enter the path to it in the set Data source field.
After that, we pressed the OK button; does anyone know the function/API for that, so that I can retrieve that path from the backend using C# and populate the table names and their corresponding columns in my TreeView controller?
Thanks in advance!
Solved! Go to Solution.
Hi,
You need to listen PropertyChanged event on each layer, o layers you want.
var layerList = MapView.Active.Map.GetLayersAsFlattenedList().OfType<Layer>();
foreach(var layer in layerList)
{
layer.PropertyChanged += MyLayerPropertyChanged;
}
private void MyLayerPropertyChanged(object sender, PropertyChangedEventArgs e)
{
// your code here
}
Hi,
You need to listen PropertyChanged event on each layer, o layers you want.
var layerList = MapView.Active.Map.GetLayersAsFlattenedList().OfType<Layer>();
foreach(var layer in layerList)
{
layer.PropertyChanged += MyLayerPropertyChanged;
}
private void MyLayerPropertyChanged(object sender, PropertyChangedEventArgs e)
{
// your code here
}
Thanks, it worked perfectly fine for me. 🙂