Class CoreWebView2ContextMenuItem
Represents a context menu item of a context menu displayed by WebView.
public class CoreWebView2ContextMenuItem
- Inheritance
-
CoreWebView2ContextMenuItem
- Inherited Members
Properties
Children
Gets the list of children menu items if the kind is Submenu.
public IList<CoreWebView2ContextMenuItem> Children { get; }
Property Value
Remarks
If the kind is not Submenu, will return null
.
CommandId
Gets the Command ID for the CoreWebView2ContextMenuItem.
public int CommandId { get; }
Property Value
Remarks
Use this to report the SelectedCommandId in ContextMenuRequested event.
Icon
Gets the Icon for the CoreWebView2ContextMenuItem in PNG, Bitmap or SVG formats in the form of an IStream.
public Stream Icon { get; }
Property Value
Remarks
Stream will be rewound to the start of the image data before being read.
IsChecked
Gets or sets the checked property of the CoreWebView2ContextMenuItem.
public bool IsChecked { get; set; }
Property Value
Remarks
IsEnabled
Gets or sets the enabled property of the CoreWebView2ContextMenuItem. Must only be used in the case of a custom context menu item.
public bool IsEnabled { get; set; }
Property Value
Remarks
The default value for this is true
.
Kind
Gets the kind of CoreWebView2ContextMenuItem as CoreWebView2ContextMenuItemKind.
public CoreWebView2ContextMenuItemKind Kind { get; }
Property Value
Label
Gets the localized label for the CoreWebView2ContextMenuItem. Will contain an ampersand for characters to be used as keyboard accelerator.
public string Label { get; }
Property Value
Name
Gets the unlocalized name for the CoreWebView2ContextMenuItem.
public string Name { get; }
Property Value
Remarks
Use this to distinguish between context menu item types. This will be the English label of the menu item in lower camel case. For example, the "Save as" menu item will be "saveAs". Extension menu items will be "extension", custom menu items will be "custom" and spellcheck items will be "spellCheck". Some example context menu item names are:
- "saveAs"
- "copyImage"
- "openLinkInNewWindow"
ShortcutKeyDescription
Gets the localized keyboard shortcut for this CoreWebView2ContextMenuItem.
public string ShortcutKeyDescription { get; }
Property Value
Remarks
It will be the empty string if there is no keyboard shortcut. This is text intended to be displayed to the end user to show the keyboard shortcut. For example this property is Ctrl+Shift+I for the "Inspect" CoreWebView2ContextMenuItem.
Events
CustomItemSelected
CustomItemSelected event is raised when the user selects this CoreWebView2ContextMenuItem.
public event EventHandler<object> CustomItemSelected
Event Type
Remarks
Will only be raised for end developer created context menu items.