Back to Devexpress

ColorListLegend Class

windowsforms-devexpress-dot-xtramap-1a5637dc.md

latest2.6 KB
Original Source

ColorListLegend Class

Represents a color legend as a list of colors.

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
public class ColorListLegend :
    ColorLegendBase,
    IImageCollectionHelper
vb
Public Class ColorListLegend
    Inherits ColorLegendBase
    Implements IImageCollectionHelper

Remarks

To show this legend on a map, create an instance of the ColorListLegend class and add it to the MapControl.Legends. Then, specify the ItemsLayerLegend.Layer property of the instance. Note that a layer assigned to the legend should contain a colorizer.

The following image shows an instance of Color List Legend.

For more information, refer to Legends.

Example

To add a color legend listing the colors on the Map, create an instance of the ColorListLegend class and specify its ItemsLayerLegend.Layer property. Optionally, specify MapLegendBase.Header, MapLegendBase.Description and other properties.

csharp
// Add a legend to the map.
map.Legends.Add(new ColorListLegend() {
    Header = "Room Type",
    Layer = hotelLayer
});
vb
' Add a legend to the map.
map.Legends.Add(New ColorListLegend() With {.Header = "Room Type", .Layer = hotelLayer})

Inheritance

Object MapDisposableObject MapLegendBase DataProviderLegend ItemsLayerLegend ColorLegendBase ColorListLegend

See Also

ColorListLegend Members

DevExpress.XtraMap Namespace