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, IControl, IFrameworkElement, IUIElement, IDependencyObject
Constructors
| Improve this Doc View SourceContextMenu()
Initializes a new instance of the 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 popup alignment point.
Declaration
[TypeConverter(typeof(LengthConverter))]
public double HorizontalOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
IsOpen
Gets or sets a value indicating whether the ContextMenu is visible.
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 popup alignment point.
Declaration
[TypeConverter(typeof(LengthConverter))]
public double VerticalOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
| Improve this Doc View SourceOnClosed(RoutedEventArgs)
Called when the Closed event occurs.
Declaration
protected virtual void OnClosed(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
RoutedEventArgs | e | Event arguments. |
OnKeyDown(KeyEventArgs)
Responds to the KeyDown event.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
KeyEventArgs | e | The event data for the KeyDown event. |
Overrides
| Improve this Doc View SourceOnMouseLeftButtonDown(MouseButtonEventArgs)
Called when the left mouse button is pressed.
Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseButtonEventArgs | e | The event data for the MouseLeftButtonDown event. |
Overrides
| Improve this Doc View SourceOnMouseRightButtonDown(MouseButtonEventArgs)
Called when the right mouse button is pressed.
Declaration
protected override void OnMouseRightButtonDown(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseButtonEventArgs | e | The event data for the MouseRightButtonDown event. |
Overrides
| Improve this Doc View SourceOnOpened(RoutedEventArgs)
Called when the Opened event occurs.
Declaration
protected virtual void OnOpened(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
RoutedEventArgs | e | Event arguments. |
Events
| Improve this Doc View SourceClosed
Occurs when a particular instance of a ContextMenu closes.
Declaration
public event RoutedEventHandler Closed
Event Type
Type | Description |
---|---|
RoutedEventHandler |
Opened
Occurs when a particular instance of a ContextMenu opens.
Declaration
public event RoutedEventHandler Opened
Event Type
Type | Description |
---|---|
RoutedEventHandler |