Skip to main content

MapEditor.MapItemEdited Event

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

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v23.2.dll

NuGet Package: DevExpress.Win.Map

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;
        }
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the MapItemEdited event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also