Class RadContextMenu
Represents a context menu control that enables you to hierarchically organize elements with associated event handlers.
Inherited Members
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.Navigation.dll
Syntax
[TelerikToolboxCategory("Navigation")]
public class RadContextMenu : MenuBase, IPopupAware
Constructors
RadContextMenu()
Fields
AttachOnHandledEventsProperty
Identifies the AttachOnHandledEvents dependency property.
Declaration
public static readonly DependencyProperty AttachOnHandledEventsProperty
Field Value
System.Windows.DependencyProperty
|
ClosedEvent
Identifies the Closed routed event.
Declaration
public static readonly RoutedEvent ClosedEvent
Field Value
System.Windows.RoutedEvent
|
ContextMenuProperty
Identifies the RadContextMenu attached property.
Declaration
public static readonly DependencyProperty ContextMenuProperty
Field Value
System.Windows.DependencyProperty
|
EventNameProperty
Identifies the EventName dependency property.
Declaration
public static readonly DependencyProperty EventNameProperty
Field Value
System.Windows.DependencyProperty
|
HorizontalOffsetProperty
Identifies the HorizontalOffset dependency property.
Declaration
public static readonly DependencyProperty HorizontalOffsetProperty
Field Value
System.Windows.DependencyProperty
|
InheritDataContextProperty
Identifies the InheritDataContext dependency property.
Declaration
public static readonly DependencyProperty InheritDataContextProperty
Field Value
System.Windows.DependencyProperty
|
IsOpenProperty
Identifies the IsOpen dependency property.
Declaration
public static readonly DependencyProperty IsOpenProperty
Field Value
System.Windows.DependencyProperty
|
ModifierKeyProperty
Identifies the ModifierKey dependency property.
Declaration
public static readonly DependencyProperty ModifierKeyProperty
Field Value
System.Windows.DependencyProperty
|
OpenedEvent
Identifies the Opened routed event.
Declaration
public static readonly RoutedEvent OpenedEvent
Field Value
System.Windows.RoutedEvent
|
OpeningEvent
Identifies the Opening routed event.
Declaration
public static readonly RoutedEvent OpeningEvent
Field Value
System.Windows.RoutedEvent
|
PlacementProperty
Identifies the Placement dependency property.
Declaration
public static readonly DependencyProperty PlacementProperty
Field Value
System.Windows.DependencyProperty
|
PlacementRectangleProperty
Identifies the PlacementRectangle dependency property.
Declaration
public static readonly DependencyProperty PlacementRectangleProperty
Field Value
System.Windows.DependencyProperty
|
PlacementTargetProperty
Identifies the PlacementTarget dependency property.
Declaration
public static readonly DependencyProperty PlacementTargetProperty
Field Value
System.Windows.DependencyProperty
|
RestoreFocusToTargetElementProperty
Identifies the RestoreFocusToTargetElement dependency property.
Declaration
public static readonly DependencyProperty RestoreFocusToTargetElementProperty
Field Value
System.Windows.DependencyProperty
|
ShowKeyboardCuesOnOpenProperty
Identifies the ShowKeyboardCuesOnOpen dependency property.
Declaration
public static readonly DependencyProperty ShowKeyboardCuesOnOpenProperty
Field Value
System.Windows.DependencyProperty
|
StaysOpenProperty
Identifies the StaysOpen dependency property.
Declaration
public static readonly DependencyProperty StaysOpenProperty
Field Value
System.Windows.DependencyProperty
|
UIElementProperty
Identifies the UIElement read-only dependency property.
Declaration
public static readonly DependencyProperty UIElementProperty
Field Value
System.Windows.DependencyProperty
|
VerticalOffsetProperty
Identifies the VerticalOffset dependency property.
Declaration
public static readonly DependencyProperty VerticalOffsetProperty
Field Value
System.Windows.DependencyProperty
|
Properties
AttachOnHandledEvents
Gets or sets whether RadContextMenu will open on handled routed events. The default value is false. This is a dependency property.
Declaration
public bool AttachOnHandledEvents { get; set; }
Property Value
System.Boolean
|
EventName
Gets or sets the name of the event that will open the context menu.
Declaration
public string EventName { get; set; }
Property Value
System.String
The name of the event. |
HandlesScrolling
Gets whether the control supports scrolling.
Declaration
protected override bool HandlesScrolling { get; }
Property Value
System.Boolean
|
HorizontalOffset
Get or sets the horizontal distance between the target origin and the popup alignment point. This is a dependency property.
Declaration
public double HorizontalOffset { get; set; }
Property Value
System.Double
|
InheritDataContext
Get or sets whether RadContextMenu will inherit DataContext of the element on which it is attached. This is a dependency property.
Declaration
public bool InheritDataContext { get; set; }
Property Value
System.Boolean
|
IsOpen
Gets or sets a value that indicates whether the RadContextMenu is visible. This is a dependency property.
Declaration
public bool IsOpen { get; set; }
Property Value
System.Boolean
|
ModifierKey
Gets or sets a ModifierKey that should be pressed when EventName event occurs to open the RadContextMenu. This is a dependency property.
Declaration
public ModifierKeys ModifierKey { get; set; }
Property Value
System.Windows.Input.ModifierKeys
|
MousePosition
Gets the position of the mouse at the moment when the menu was opened relative to the element that caused RadContextMenu to open. Returns Point(double.NaN, double.NaN) if context menu is closed or if the event caused context menu Opened is not Mouse event (e.g. not MouseRightButtonUp, MouseLeftButtonUp, etc.).
Declaration
public Point MousePosition { get; }
Property Value
System.Windows.Point
|
Placement
Gets or sets the Placement property of a RadContextMenu. This is a dependency property.
Declaration
public PlacementMode Placement { get; set; }
Property Value
System.Windows.Controls.Primitives.PlacementMode
|
PlacementRectangle
Gets or sets the area relative to which the context menu is positioned when it opens. This is a dependency property.
Declaration
public Rect PlacementRectangle { get; set; }
Property Value
System.Windows.Rect
|
PlacementTarget
Gets or sets the PlacementTarget. This is a dependency property.
Declaration
public UIElement PlacementTarget { get; set; }
Property Value
System.Windows.UIElement
|
RestoreFocusToTargetElement
Gets or sets a value indicating whether the focus should be returned to the target UIElement when menu is closed.
Declaration
public bool RestoreFocusToTargetElement { get; set; }
Property Value
System.Boolean
|
ShowKeyboardCuesOnOpen
Gets or sets a value indicating whether the keyboard cues should be shown when the menu is opened. Default value is null - keyboard cues will be auto shown when the menu is opened through the keyboard. If set to true keyboard cues will be always shown and if set to false will be never shown when opened.
Declaration
public Nullable<bool> ShowKeyboardCuesOnOpen { get; set; }
Property Value
System.Nullable<System.Boolean>
|
StaysOpen
Gets or sets a value that indicates whether the RadContextMenu should close automatically. This is a dependency property.
Declaration
public bool StaysOpen { get; set; }
Property Value
System.Boolean
|
UIElement
Gets the element on which RadContextMenu is attached.
Declaration
public UIElement UIElement { get; }
Property Value
System.Windows.UIElement
|
VerticalOffset
Get or sets the vertical distance between the target origin and the popup alignment point. This is a dependency property.
Declaration
public double VerticalOffset { get; set; }
Property Value
System.Double
|
Methods
add_Opening(RadRoutedEventHandler)
Declaration
public void add_Opening(RadRoutedEventHandler value)
Parameters
RadRoutedEventHandler
value
|
ClearContainerForItemOverride(DependencyObject, Object)
When overridden in a derived class, undoes the effects of the System.Windows.Controls.ItemsControl.PrepareContainerForItemOverride(System.Windows.DependencyObject,System.Object) method.
Declaration
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameters
System.Windows.DependencyObject
element
The container element. |
System.Object
item
The Item. |
Overrides
GetClickedElement<T>()
Returns the first element of the given type at the click point coordinates.
Declaration
public T GetClickedElement<T>()
where T : FrameworkElement
Returns
T
|
Type Parameters
T
The type of the element to be returned. |
GetContextMenu(FrameworkElement)
Gets the value of the ContextMenu property of the specified element.
Declaration
public static RadContextMenu GetContextMenu(FrameworkElement element)
Parameters
System.Windows.FrameworkElement
element
|
Returns
RadContextMenu
|
OnApplyTemplate()
Declaration
public override void OnApplyTemplate()
OnClosed(RadRoutedEventArgs)
Called when the Closed event occurs.
Declaration
protected virtual void OnClosed(RadRoutedEventArgs e)
Parameters
RadRoutedEventArgs
e
|
OnCreateAutomationPeer()
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
System.Windows.Automation.Peers.AutomationPeer
|
OnInitialized(EventArgs)
Raises the System.Windows.FrameworkElement.Initialized event. This method is invoked whenever System.Windows.FrameworkElement.IsInitialized is set to true internally.
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
System.EventArgs
e
The System.Windows.RoutedEventArgs that contains the event data. |
OnKeyDown(KeyEventArgs)
Invoked when keyboard key is pressed while the element has focus.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
System.Windows.Input.KeyEventArgs
e
The KeyEventArgs that contains the event data. |
Overrides
OnKeyUp(KeyEventArgs)
Invoked when keyboard key is released while the element has focus.
Declaration
protected override void OnKeyUp(KeyEventArgs e)
Parameters
System.Windows.Input.KeyEventArgs
e
The KeyEventArgs that contains the event data. |
OnOpened(RadRoutedEventArgs)
Called when the Opened event occurs.
Declaration
protected virtual void OnOpened(RadRoutedEventArgs e)
Parameters
RadRoutedEventArgs
e
|
PrepareContainerForItemOverride(DependencyObject, Object)
Prepares the specified element to display the specified item.
Declaration
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameters
System.Windows.DependencyObject
element
Element used to display the specified item. |
System.Object
item
Specified item. |
Overrides
remove_Opening(RadRoutedEventHandler)
Declaration
public void remove_Opening(RadRoutedEventHandler value)
Parameters
RadRoutedEventHandler
value
|
SetContextMenu(FrameworkElement, RadContextMenu)
Sets the value of the ContextMenu property of the specified element.
Declaration
public static void SetContextMenu(FrameworkElement element, RadContextMenu value)
Parameters
System.Windows.FrameworkElement
element
|
RadContextMenu
value
|
Events
Closed
Occurs when a particular instance of a RadContextMenu closes.
Declaration
public event RoutedEventHandler Closed
Event Type
System.Windows.RoutedEventHandler
|
Opened
Occurs when a particular instance of a RadContextMenu opens.
Declaration
public event RoutedEventHandler Opened
Event Type
System.Windows.RoutedEventHandler
|
Opening
Occurs before particular instance of RadContextMenu opens. If it is handled then RadContextMenu will not open.
Declaration
public event RadRoutedEventHandler Opening
Event Type
RadRoutedEventHandler
|