public void SetDisplayCacheMaxAge( TimeSpan displayCacheAge )
Public Sub SetDisplayCacheMaxAge( _ ByVal displayCacheAge As TimeSpan _ )
Parameters
- displayCacheAge
public void SetDisplayCacheMaxAge( TimeSpan displayCacheAge )
Public Sub SetDisplayCacheMaxAge( _ ByVal displayCacheAge As TimeSpan _ )
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(() => { // change the layer cache type to maximum age //At 2.x - featureLayer.SetDisplayCacheType(ArcGIS.Core.CIM.DisplayCacheType.MaxAge); featureLayer.SetCacheOptions(LayerCacheType.MaxAge); // change from the default 5 min to 2 min featureLayer.SetDisplayCacheMaxAge(TimeSpan.FromMinutes(2)); });
Target Platforms: Windows 11, Windows 10