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