Back to Devexpress

LegendItemCreatingEventArgs Class

windowsforms-devexpress-dot-xtramap-f4499dbf.md

latest2.7 KB
Original Source

LegendItemCreatingEventArgs Class

Provides data for the MapControl.LegendItemCreating event.

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
public class LegendItemCreatingEventArgs :
    EventArgs,
    ILegendItemCreatingEventArgs
vb
Public Class LegendItemCreatingEventArgs
    Inherits EventArgs
    Implements ILegendItemCreatingEventArgs

LegendItemCreatingEventArgs is the data class for the following events:

Remarks

The LegendItemCreatingEventArgs class introduces the LegendItemCreatingEventArgs.Index and LegendItemCreatingEventArgs.Item properties that provide information about the legend item; and the LegendItemCreatingEventArgs.Legend property that provides access to the legend.

Note that LegendItemCreatingEventArgs objects are automatically created, initialized and passed to the corresponding event handlers.

Example

To manually customize legend items, implement the MapControl.LegendItemCreating event handler, where you can configure MapLegendItemBase descendant class objects as you wish.

The following instance demonstrates how to do this.

csharp
void map_LegendItemCreating(object sender, LegendItemCreatingEventArgs e) {
    e.Item.Text = String.Format("{0}$", e.Item.Value);
}
vb
Private Sub map_LegendItemCreating(ByVal sender As Object, ByVal e As LegendItemCreatingEventArgs)
    e.Item.Text = String.Format("{0}$", e.Item.Value)
End Sub

Inheritance

Object EventArgs LegendItemCreatingEventArgs

See Also

LegendItemCreatingEventArgs Members

DevExpress.XtraMap Namespace