public void SetLabelVisibility( bool isLabelVisible )
Public Sub SetLabelVisibility( _ ByVal isLabelVisible As Boolean _ )
Parameters
- isLabelVisible
- true make labels to draw.
public void SetLabelVisibility( bool isLabelVisible )
Public Sub SetLabelVisibility( _ ByVal isLabelVisible As Boolean _ )
Exception | Description |
---|---|
ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { // toggle the label visibility featureLayer.SetLabelVisibility(!featureLayer.IsLabelVisible); });
//Note: call within QueuedTask.Run() if (!featureLayer.IsLabelVisible) //set the label's visiblity featureLayer.SetLabelVisibility(true);
Target Platforms: Windows 11, Windows 10