ArcGIS Pro SDK 切换所有图例项的自动可见性
protected void setLegend() { var lyt = LayoutView.Active?.Layout; if (lyt == null) return; QueuedTask.Run(() => { var def = lyt.GetDefinition(); var legend = def.Elements.OfType<CIMLegend>().FirstOrDefault(); if (legend != null) { //toggle auto visibility of all the legend items foreach (var leg_item in legend.Items) { leg_item.AutoVisibility = !leg_item.AutoVisibility; } //commit the change lyt.SetDefinition(def); } }); }