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

In This Topic
    Legend Property (LegendStyleItem)
    In This Topic
    Gets or sets the ArcGIS.Core.CIM.CIMLegend of the legend style item.
    Syntax
    public CIMLegend Legend {get; set;}
    Public Property Legend As CIMLegend
    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, Windows 8.1

    See Also