Class MapLegendElement
Represents a legend element for map controls that displays legend information with customizable orientation, spacing, and visual formatting.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.RadMap.dll
Syntax
public class MapLegendElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Constructors
MapLegendElement()
Initializes a new instance of the MapLegendElement class with default settings and no legend information provider.
Declaration
public MapLegendElement()
MapLegendElement(IMapLegendInfoProvider)
Initializes a new instance of the MapLegendElement class with the specified legend information provider and automatically initializes legend items.
Declaration
public MapLegendElement(IMapLegendInfoProvider legendInfoProvider)
Parameters
|
IMapLegendInfoProvider
legendInfoProvider
The IMapLegendInfoProvider that supplies legend information for display. |
Fields
HorizontalOrientationItemSpacingProperty
Identifies the HorizontalOrientationItemSpacing dependency property that sets the spacing between items when arranged horizontally.
Declaration
public static RadProperty HorizontalOrientationItemSpacingProperty
Field Value
|
RadProperty
|
OrientationProperty
Identifies the Orientation dependency property that determines the layout direction of legend items.
Declaration
public static RadProperty OrientationProperty
Field Value
|
RadProperty
|
VerticalOrientationItemSpacingProperty
Identifies the VerticalOrientationItemSpacing dependency property that sets the spacing between items when arranged vertically.
Declaration
public static RadProperty VerticalOrientationItemSpacingProperty
Field Value
|
RadProperty
|
Properties
Converter
Gets or sets the type converter used for converting legend item data to displayable text representation.
Declaration
public TypeConverter Converter { get; set; }
Property Value
|
System.ComponentModel.TypeConverter
|
HorizontalOrientationItemSpacing
Gets or sets the spacing between legend items when the legend orientation is set to horizontal.
Declaration
public int HorizontalOrientationItemSpacing { get; set; }
Property Value
|
System.Int32
|
ItemStackElement
Gets the stack layout element that specifically contains and arranges the individual legend item elements with configurable spacing.
Declaration
public StackLayoutElement ItemStackElement { get; }
Property Value
|
StackLayoutElement
|
LegendInfoProvider
Gets or sets the legend information provider that supplies data for populating legend items and automatically reinitializes the legend when changed.
Declaration
public IMapLegendInfoProvider LegendInfoProvider { get; set; }
Property Value
|
IMapLegendInfoProvider
|
Orientation
Gets or sets the orientation that determines how legend items are arranged, either vertically or horizontally within the legend.
Declaration
public Orientation Orientation { get; set; }
Property Value
|
System.Windows.Forms.Orientation
|
StackElement
Gets the main stack layout element that contains and organizes the title, subtitle, and item stack elements within the legend.
Declaration
public StackLayoutElement StackElement { get; }
Property Value
|
StackLayoutElement
|
SubtitleElement
Gets the subtitle element that displays secondary text below the title in the legend.
Declaration
public MapLegendSubtitleElement SubtitleElement { get; }
Property Value
|
MapLegendSubtitleElement
|
TitleElement
Gets the title element that displays the main title text at the top of the legend.
Declaration
public MapLegendTitleElement TitleElement { get; }
Property Value
|
MapLegendTitleElement
|
VerticalOrientationItemSpacing
Gets or sets the spacing between legend items when the legend orientation is set to vertical.
Declaration
public int VerticalOrientationItemSpacing { get; set; }
Property Value
|
System.Int32
|
Methods
CreateChildElements()
Creates and initializes the child elements of the legend, including title, subtitle, and item stack layout elements.
Declaration
protected override void CreateChildElements()
Overrides
CreateItemsStackLayoutElement()
Creates and configures the stack layout element specifically for arranging legend items with appropriate spacing and orientation settings.
Declaration
protected virtual StackLayoutElement CreateItemsStackLayoutElement()
Returns
|
StackLayoutElement
A configured StackLayoutElement for legend item arrangement and spacing. |
CreateMapLegendItemElement(MapLegendInfoItem)
Creates a map legend item element based on the provided legend information item, including text conversion and orientation configuration.
Declaration
protected virtual MapLegendItemElement CreateMapLegendItemElement(MapLegendInfoItem item)
Parameters
|
MapLegendInfoItem
item
The MapLegendInfoItem containing the data for creating the legend item element. |
Returns
|
MapLegendItemElement
A configured MapLegendItemElement representing the legend item for display. |
CreateStackLayoutElement()
Creates and configures the main stack layout element for organizing title, subtitle, and item container within the legend.
Declaration
protected virtual StackLayoutElement CreateStackLayoutElement()
Returns
|
StackLayoutElement
A configured StackLayoutElement for the legend's main layout structure. |
CreateSubtitleElement()
Creates and configures a subtitle element for the legend with appropriate text alignment and stretch settings.
Declaration
protected virtual MapLegendSubtitleElement CreateSubtitleElement()
Returns
|
MapLegendSubtitleElement
A configured MapLegendSubtitleElement for the legend subtitle display. |
CreateTitleElement()
Creates and configures a title element for the legend with appropriate text alignment and stretch settings.
Declaration
protected virtual MapLegendTitleElement CreateTitleElement()
Returns
|
MapLegendTitleElement
A configured MapLegendTitleElement for the legend title display. |
GetDisplayText(MapLegendInfoItem)
Gets the display text for a legend item by converting it using the configured type converter.
Declaration
protected virtual string GetDisplayText(MapLegendInfoItem item)
Parameters
|
MapLegendInfoItem
item
The MapLegendInfoItem to convert to display text. |
Returns
|
System.String
A string representation of the legend item for display purposes. |
Initialize()
Initializes and populates the legend items by clearing existing items and creating new elements based on the current LegendInfoProvider data.
Declaration
public virtual void Initialize()
InitializeFields()
Initializes the default field values and visual properties for the legend element, including background color, focus settings, and alignment.
Declaration
protected override void InitializeFields()
Overrides
OnPropertyChanged(RadPropertyChangedEventArgs)
Handles property change notifications, managing orientation updates, item spacing changes, and layout invalidation for the legend display.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
|
RadPropertyChangedEventArgs
e
A RadPropertyChangedEventArgs containing the property change information. |