Color legend plain property dependency property method event
An item of a context menu: a check mark while it is checkable and checked, its content, and an arrow at the right end when it opens a sub-menu. While one item of the menu is checkable, every item keeps the check mark’s column, so the contents line up; while one opens a sub-menu, every item keeps the arrow’s column, so the items end alike. The item is stretched over its row; the row takes the mouse and the item shows its state. Choosing it, with a click or the keyboard, raises its OnClick and the menu’s OnItemSelect.
ContextMenuItem derives from BaseElement and has its members too. The lists and menus page shows it in context, with code and screenshots.
Names are colored by what they are: a plain property, a method, an event or a dependency property, which a style, a binding or an animation can set.
Properties
Content 🠆
BaseElement · Read-only. The element the item shows, given when it is made.
HasSubItems 🠆
bool · Read-only. Whether the item has a sub-menu with at least one item.
IsCheckable 🠆
bool · Whether choosing the item switches IsChecked. Setting it to false also clears IsChecked.
IsChecked 🠆
bool · Whether the check mark of a checkable item is shown.
MouseCursorsSet 🠆
MouseCursorsSet · Read-only. The mouse cursors of the row the item is in.
ParentMenu 🠆
ContextMenu · Read-only. The menu the item is in.
Source 🠆
object · Read-only. The ItemsSource object the item shows, null for an item added in code.
SubMenu 🠆
ContextMenu · The menu opened next to the item, on hover or click (see the menu’s SubMenusOpenType). The arrow shows while it has items.
Methods
ContextMenuItem() 🠆
ContextMenuItem(string text, string name = null) · Creates an item showing the text in a label.
| Parameter | Type | Description |
|---|---|---|
text |
string |
The text of the item’s label. |
name |
string |
The element’s Name, which GetElementByName finds it by. Default: null. |
ContextMenuItem(BaseElement content, string name = null) · Creates an item showing any element.
| Parameter | Type | Description |
|---|---|---|
content |
BaseElement |
The element the item shows, its Content. |
name |
string |
The element’s Name, which GetElementByName finds it by. Default: null. |