ContextMenu
Wisej.Web.ContextMenu
Namespace: Wisej.Web
Assembly: Wisej.Framework (3.1.0.0)
Represents a context menu associated to a Control.
Constructors
ContextMenu()
Initializes a new instance of the ContextMenu class with no menu items specified.
ContextMenu(menuItems)
Initializes a new instance of the ContextMenu class with a specified set of MenuItem objects.
menuItems
An array of MenuItem objects that represent the menu items to add to the shortcut menu.
ContextMenu(container)
Initializes a new instance of the ToolTip class with a specified container.
Properties
RightToLeft
RightToLeft: Returns or sets whether the text displayed by the control is displayed from right to left.
SourceComponent
IWisejComponent: Returns the component that is displaying the shortcut menu.
SourceControl
Control: Returns the control that is displaying the shortcut menu.
Methods
Show(component, position, onclose)
Displays the context menu at the specified position in relation to the specified component.
Show(pos, onclose)
Displays the context menu at the specified position.
onclose
Optional async handler for the close event; called when the context menu has been closed. It's the equivalent of handling the event.
Show(control, position, onclose)
Displays the context menu at the specified position in relation to the specified control.
Throws:
ArgumentNullException The control parameter is null.
ArgumentException The control is not visible.
Show(control, pos, onclose)
Displays the context menu at the specified position in relation to the specified control.
pos
A Point that specifies the coordinates at which to display the menu. These coordinates are specified relative to the client coordinates of the control specified in the control parameter.
onclose
Optional async handler for the close event; called when the context menu has been closed. It's the equivalent of handling the event.
Throws:
ArgumentNullException The control parameter is null.
ArgumentException The handle of the control does not exist or the control is not visible.
Show(control, pos, alignment, onclose)
Displays the context menu at the specified position and with the specified alignment in relation to the specified control.
pos
A Point that specifies the coordinates at which to display the menu. These coordinates are specified relative to the client coordinates of the control specified in the control parameter.
alignment
A LeftRightAlignment that specifies the alignment of the control relative to the pos parameter.
onclose
Optional async handler for the close event; called when the context menu has been closed. It's the equivalent of handling the event.
Throws:
ArgumentNullException The control parameter is null.
ArgumentException The control is not visible.
ShowAsync(component, position)
Asynchronously displays the context menu at the specified position in relation to the specified component.
Returns: Task.
ShowAsync(pos)
Asynchronously displays the context menu at the specified position.
Returns: Task.
ShowAsync(control, position)
Asynchronously displays the context menu at the specified position in relation to the specified control.
Returns: Task.
Throws:
ArgumentNullException The control parameter is null.
ArgumentException The control is not visible.
ShowAsync(control, pos)
Asynchronously displays the context menu at the specified position in relation to the specified control.
Returns: Task.
Throws:
ArgumentNullException The control parameter is null.
ArgumentException The handle of the control does not exist or the control is not visible.
ShowAsync(control, pos, alignment)
Asynchronously displays the context menu at the specified position and with the specified alignment in relation to the specified control.
pos
A Point that specifies the coordinates at which to display the menu. These coordinates are specified relative to the client coordinates of the control specified in the control parameter.
alignment
A LeftRightAlignment that specifies the alignment of the control relative to the pos parameter.
Returns: Task.
Throws:
ArgumentNullException The control parameter is null.
ArgumentException The control is not visible.
Update()
Updates the component on the client. Overridden to update the owner control.
Events
Collapse
EventHandler Fired when the context menu collapses.
Load
EventHandler Occurs before the context menu is displayed on the client.
Popup
EventHandler Occurs after the context menu is displayed on the client.
Implements
All wisej components implement this interface.
Allows an object to serialize itself.
Last updated