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
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
RoutedEvent
|
OpeningEvent
Identifies the Opening routed event.
Declaration
public static readonly RoutedEvent OpeningEvent
Field Value
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
|
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. |
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
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
|
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
|
ChangeVisualState(Boolean)
Updates the visual state of the control.
Declaration
protected override void ChangeVisualState(bool useTransitions)
Parameters
System.Boolean
useTransitions
Indicates whether transitions should be used. |
Overrides
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()
When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call System.Windows.Controls.Control.ApplyTemplate.
Declaration
public override void OnApplyTemplate()
Overrides
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
|
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
OnMouseRightButtonDown(MouseButtonEventArgs)
Handles MouseRightButtonDown event if there is no selection. This is done to prevent showing Silverlight Context Menu.
Declaration
protected override void OnMouseRightButtonDown(MouseButtonEventArgs e)
Parameters
System.Windows.Input.MouseButtonEventArgs
e
The event args. |
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
|