ImageEditToEditModeBehavior.CustomEditMenuItems Event
Allows you to change items displayed in the ImageEdit edit menu.
Namespace: DevExpress.Xpf.Editors
Assembly: DevExpress.Xpf.Core.v25.2.dll
NuGet Package: DevExpress.Wpf.Core
Declaration
Event Data
The CustomEditMenuItems event's data class is CustomEditMenuItemsEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| EditMenuItems | Gets or sets a collection of items displayed in the ImageEdit edit menu. |
Remarks
The CustomEditMenuItems event occurs when the editor is displayed (if ShowMenuMode is set to Always) or each time the edit menu is shown (if ShowMenuMode is set to Hover). This event allows you to add and remove buttons.
The following code sample removes zoom-related buttons (Zoom In and Zoom Out) and adds confirmation buttons (OK and Cancel):

void editBehavior_CustomEditMenuItems(object sender, DevExpress.Xpf.Editors.CustomEditMenuItemsEventArgs e) {
// Remove Zoom buttons:
var items = ((ImageEditToEditModeBehavior)sender).EditMenuItems;
foreach (var item in items) {
if (item is ImageEditToolButtonInfo button
&& button.Command == ((ImageEditToEditModeBehavior)sender).ZoomCommand)
e.EditMenuItems.Remove(item);
}
// Add OK and Cancel buttons:
e.EditMenuItems.Add(new ImageEditToolSeparatorInfo());
e.EditMenuItems.Add(new ImageEditToolButtonInfo() {
Glyph = ImageEditToolButtonHelper.ImageIdToImageSource("ok"),
ToolTip = "OK",
Command = new DelegateCommand(Confirm)
});
e.EditMenuItems.Add(new ImageEditToolButtonInfo() {
Glyph = ImageEditToolButtonHelper.ImageIdToImageSource("cancel"),
ToolTip = "Cancel",
Command = new DelegateCommand(Close)
});
}
The CustomEditMenuItems event does not allow you to change items defined through the MenuTemplate property.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CustomEditMenuItems 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.