MapEditor.MapItemEdited Event

Occurs when the Map Editor is used to add, edit or remove a map item.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v21.1.dll

Declaration

[Browsable(false)]
public event MapItemEditedEventHandler MapItemEdited

Event Data

The MapItemEdited event's data class is MapItemEditedEventArgs. The following properties provide information specific to this event:

Property Description
Action Returns the action that has been applied to map items.
Items Returns map items to be represented in the map control. Inherited from MapItemsEventArgs.

Remarks

You can handle the MapItemEdited event to customize the style of newly created items:

private void Form1_Load(object sender, EventArgs e) {
    this.mapControl1.MapEditor.MapItemEdited += MapEditor_MapItemEdited;
}

private void MapEditor_MapItemEdited(object sender, MapItemEditedEventArgs e) {
    foreach (MapItem item in e.Items) {
        if (item is MapRectangle) {
            MapRectangle rectangle = (MapRectangle)item;
            rectangle.Fill = Color.FromArgb(128, 0, 255, 0);
            rectangle.Stroke = Color.Yellow;
        }
    }
}
See Also