Class ContextMenu
Represents a pop-up menu that enables a control to expose functionality that is specific to the context of the control.
Inheritance
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
public class ContextMenu : MenuBase
Constructors
| Improve this Doc View SourceContextMenu()
Initializes a new instance of the System.Windows.Controls.ContextMenu class.
Declaration
public ContextMenu()
Fields
| Improve this Doc View SourceHorizontalOffsetProperty
Identifies the HorizontalOffset dependency property.
Declaration
public static readonly DependencyProperty HorizontalOffsetProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsOpenProperty
Identifies the IsOpen dependency property.
Declaration
public static readonly DependencyProperty IsOpenProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
VerticalOffsetProperty
Identifies the VerticalOffset dependency property.
Declaration
public static readonly DependencyProperty VerticalOffsetProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceHorizontalOffset
Gets or sets the horizontal distance between the target origin and the pop-up alignment point. The default is 0.
Declaration
public double HorizontalOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
IsOpen
Gets or sets a value that indicates whether the ContextMenu is visible. True if the ContextMenu is visible; otherwise, false. The default is false.
Declaration
public bool IsOpen { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
VerticalOffset
Gets or sets the vertical distance between the target origin and the pop-up alignment point. The default is 0.
Declaration
public double VerticalOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
| Improve this Doc View SourceINTERNAL_OpenAtCoordinates(Point)
Declaration
public void INTERNAL_OpenAtCoordinates(Point absoluteCoordinates)
Parameters
Type | Name | Description |
---|---|---|
Point | absoluteCoordinates |
OnClosed(RoutedEventArgs)
Called when the System.Windows.Controls.ContextMenu.Closed event occurs.
Declaration
protected virtual void OnClosed(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
RoutedEventArgs | e | The event data for the System.Windows.Controls.ContextMenu.Closed event. |
OnOpened(RoutedEventArgs)
Called when the System.Windows.Controls.ContextMenu.Opened event occurs.
Declaration
protected virtual void OnOpened(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
RoutedEventArgs | e | The event data for the System.Windows.Controls.ContextMenu.Opened event. |
Events
| Improve this Doc View SourceClosed
Occurs when a particular instance of a System.Windows.Controls.ContextMenu closes.
Declaration
public event RoutedEventHandler Closed
Event Type
Type | Description |
---|---|
RoutedEventHandler |
Opened
Occurs when a particular instance of a context menu opens.
Declaration
public event RoutedEventHandler Opened
Event Type
Type | Description |
---|---|
RoutedEventHandler |