ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / LegendStyleItem Class / Legend Property
Example Version

Legend Property (LegendStyleItem)
Gets or sets the ArcGIS.Core.CIM.CIMLegend of the legend style item.
Syntax
public CIMLegend Legend {get; set;}
Exceptions
ExceptionDescription
This property must be called within the lambda passed to QueuedTask.Run
Example
Get legend from LegendStyleItem
LegendStyleItem legendStyleItem = null;
CIMLegend legend = await QueuedTask.Run<CIMLegend>(() =>
{
  return legendStyleItem.Legend;
});
Get legend from LegendStyleItem
LegendStyleItem legendStyleItem = null;
CIMLegend legend = await QueuedTask.Run<CIMLegend>(() =>
{
  return legendStyleItem.Legend;
});
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also