public ReadOnlyObservableCollection<Layer> Layers {get;}
Public ReadOnly Property Layers As ReadOnlyObservableCollection(Of Layer)
public ReadOnlyObservableCollection<Layer> Layers {get;}
Public ReadOnly Property Layers As ReadOnlyObservableCollection(Of Layer)
public async Task ObtainingGeodatabaseFromFeatureLayer() { IEnumerable<Layer> layers = MapView.Active.Map.Layers.Where(layer => layer is FeatureLayer); await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { foreach (FeatureLayer featureLayer in layers) { using (Table table = featureLayer.GetTable()) using (Datastore datastore = table.GetDatastore()) { if (datastore is UnknownDatastore) continue; Geodatabase geodatabase = datastore as Geodatabase; } } }); }
public void SelectAllFeatureLayersInTOC() { //Get the active map view. var mapView = MapView.Active; if (mapView == null) return; //Zoom to the selected layers in the TOC var featureLayers = mapView.Map.Layers.OfType<FeatureLayer>(); mapView.SelectLayers(featureLayers.ToList()); }
Target Platforms: Windows 11, Windows 10