Class RadMenuItem
Represents a selectable item inside a RadMenu or RadContextMenu.
Inheritance
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.Navigation.dll
Syntax
[TelerikToolboxCategory("Navigation")]
public class RadMenuItem : HeaderedItemsControl, ICommandSource
Constructors
RadMenuItem()
Initializes a new instance of the RadMenuItem class without menu text or a value.
Declaration
public RadMenuItem()
Fields
CheckedEvent
Identifies the Checked routed event.
Declaration
public static readonly RoutedEvent CheckedEvent
Field Value
System.Windows.RoutedEvent
|
CheckedIconProperty
Identifies the CheckedIcon dependency property.
Declaration
public static readonly DependencyProperty CheckedIconProperty
Field Value
System.Windows.DependencyProperty
|
CheckedIconTemplateProperty
Identifies the CheckedIconTemplate dependency property.
Declaration
public static readonly DependencyProperty CheckedIconTemplateProperty
Field Value
System.Windows.DependencyProperty
|
ClickEvent
Identifies the Click routed event.
Declaration
public static readonly RoutedEvent ClickEvent
Field Value
System.Windows.RoutedEvent
|
CommandParameterProperty
Identifies the CommandParameter dependency property.
Declaration
public static readonly DependencyProperty CommandParameterProperty
Field Value
System.Windows.DependencyProperty
|
CommandProperty
Identifies the Command dependency property.
Declaration
public static readonly DependencyProperty CommandProperty
Field Value
System.Windows.DependencyProperty
|
CommandTargetProperty
Identifies the CommandTarget property.
Declaration
public static readonly DependencyProperty CommandTargetProperty
Field Value
System.Windows.DependencyProperty
|
DropDownHeightProperty
Identifies the DropDownHeight dependency property.
Declaration
public static readonly DependencyProperty DropDownHeightProperty
Field Value
System.Windows.DependencyProperty
|
DropDownPlacementProperty
Identifies the DropDownPlacement dependency property.
Declaration
public static readonly DependencyProperty DropDownPlacementProperty
Field Value
System.Windows.DependencyProperty
|
DropDownWidthProperty
Identifies the DropDownWidth dependency property.
Declaration
public static readonly DependencyProperty DropDownWidthProperty
Field Value
System.Windows.DependencyProperty
|
IconColumnWidthProperty
Identifies the IconColumnWidth dependency property.
Declaration
public static readonly DependencyProperty IconColumnWidthProperty
Field Value
System.Windows.DependencyProperty
|
IconProperty
Identifies the Icon dependency property.
Declaration
public static readonly DependencyProperty IconProperty
Field Value
System.Windows.DependencyProperty
|
IconTemplateProperty
Identifies the IconTemplate dependency property.
Declaration
public static readonly DependencyProperty IconTemplateProperty
Field Value
System.Windows.DependencyProperty
|
InputGestureTextProperty
Identifies the InputGestureText dependency property.
Declaration
public static readonly DependencyProperty InputGestureTextProperty
Field Value
System.Windows.DependencyProperty
|
IsCheckableProperty
Identifies the IsCheckable dependency property.
Declaration
public static readonly DependencyProperty IsCheckableProperty
Field Value
System.Windows.DependencyProperty
|
IsCheckedProperty
Identifies the IsChecked dependency property.
Declaration
public static readonly DependencyProperty IsCheckedProperty
Field Value
System.Windows.DependencyProperty
|
IsCurrentProperty
Identifies the IsCurrent dependency property.
Declaration
public static readonly DependencyProperty IsCurrentProperty
Field Value
System.Windows.DependencyProperty
|
IsHighlightedProperty
Identifies the IsHighlighted dependency property.
Declaration
public static readonly DependencyProperty IsHighlightedProperty
Field Value
System.Windows.DependencyProperty
|
IsSeparatorProperty
Identifies the IsSeparatorProperty dependency property.
Declaration
public static readonly DependencyProperty IsSeparatorProperty
Field Value
System.Windows.DependencyProperty
|
IsSubmenuOpenProperty
IsSuspendingPopupAnimationProperty
Identifies the IsSuspendingPopupAnimation readonly dependency property.
Declaration
public static readonly DependencyProperty IsSuspendingPopupAnimationProperty
Field Value
System.Windows.DependencyProperty
|
ItemContainerTemplateSelectorProperty
Identifies the ItemContainerTemplateSelector dependency property.
Declaration
public static readonly DependencyProperty ItemContainerTemplateSelectorProperty
Field Value
System.Windows.DependencyProperty
|
MenuProperty
Identifies the Menu readonly dependency property.
Declaration
public static readonly DependencyProperty MenuProperty
Field Value
System.Windows.DependencyProperty
|
RoleProperty
Identifies the Role dependency property.
Declaration
public static readonly DependencyProperty RoleProperty
Field Value
System.Windows.DependencyProperty
|
SeparatorTemplateKeyProperty
Identifies the SeparatorTemplateKey dependency property.
Declaration
[Obsolete("Since 2013 Q1 this property is not needed. Please use RadMenuSeparatorItem container and set its Template property.", false)]
public static readonly DependencyProperty SeparatorTemplateKeyProperty
Field Value
System.Windows.DependencyProperty
|
StaysOpenOnClickProperty
Identifies the StaysOpenOnClick dependency property.
Declaration
public static readonly DependencyProperty StaysOpenOnClickProperty
Field Value
System.Windows.DependencyProperty
|
SubmenuClosedEvent
SubmenuHeaderTemplateKeyProperty
SubmenuItemTemplateKeyProperty
SubmenuOpenedEvent
TopLevelHeaderTemplateKeyProperty
Identifies the TopLevelHeaderTemplateKey dependency property.
Declaration
[Obsolete("Since 2013 Q1 this property is not needed. Please use RadMenuRootItem container and set its Template property.", false)]
public static readonly DependencyProperty TopLevelHeaderTemplateKeyProperty
Field Value
System.Windows.DependencyProperty
|
TopLevelItemTemplateKeyProperty
Identifies the TopLevelItemTemplateKey dependency property.
Declaration
[Obsolete("Since 2013 Q1 this property is not needed. Please use RadMenuRootItem container and set its Template property.", false)]
public static readonly DependencyProperty TopLevelItemTemplateKeyProperty
Field Value
System.Windows.DependencyProperty
|
UncheckedEvent
Identifies the Unchecked routed event.
Declaration
public static readonly RoutedEvent UncheckedEvent
Field Value
System.Windows.RoutedEvent
|
Properties
CheckedIcon
Gets or sets the icon that appears in a RadMenuItem when it is checkable and is checked. This is a dependency property.
Declaration
public object CheckedIcon { get; set; }
Property Value
System.Object
|
CheckedIconTemplate
Gets or sets the data template used for the CheckedIcon. This is a dependency property.
Declaration
public DataTemplate CheckedIconTemplate { get; set; }
Property Value
System.Windows.DataTemplate
|
Command
Gets the command that will be executed when the command source is invoked.
Declaration
public ICommand Command { get; set; }
Property Value
System.Windows.Input.ICommand
|
CommandParameter
Represents a user defined data value that can be passed to the command when it is executed.
Declaration
public object CommandParameter { get; set; }
Property Value
System.Object
|
CommandTarget
The object that the command is being executed on.
Declaration
public IInputElement CommandTarget { get; set; }
Property Value
System.Windows.IInputElement
|
DropDownHeight
Gets or sets the height of the drop-down area.
Declaration
public double DropDownHeight { get; set; }
Property Value
System.Double
|
DropDownPlacement
Gets or sets the placement of the drop-down area.
Declaration
public MenuPlacementMode DropDownPlacement { get; set; }
Property Value
MenuPlacementMode
|
DropDownWidth
Gets or sets the width of the drop-down area.
Declaration
public double DropDownWidth { get; set; }
Property Value
System.Double
|
HandlesScrolling
Gets whether the control supports scrolling.
Declaration
protected override bool HandlesScrolling { get; }
Property Value
System.Boolean
|
Icon
Gets or sets the icon that appears in a RadMenuItem. This is a dependency property.
Declaration
[SRCategory("Appearance")]
public object Icon { get; set; }
Property Value
System.Object
|
IconColumnWidth
Gets or sets the width of the column that contains the icon.
Declaration
public double IconColumnWidth { get; set; }
Property Value
System.Double
|
IconTemplate
Gets or sets the data template used for Icon. This is a dependency property.
Declaration
public DataTemplate IconTemplate { get; set; }
Property Value
System.Windows.DataTemplate
|
InputGestureText
Gets or sets the text describing an input gesture that will call the command tied to the specified item.
Declaration
public string InputGestureText { get; set; }
Property Value
System.String
|
IsCheckable
Gets a value that indicates whether a RadMenuItem can be checked. This is a dependency property.
Declaration
[SRCategory("Behavior")]
public bool IsCheckable { get; set; }
Property Value
System.Boolean
|
IsChecked
Gets or sets a value that indicates whether the RadMenuItem is checked. This is a dependency property.
Declaration
[SRCategory("Appearance")]
public bool IsChecked { get; set; }
Property Value
System.Boolean
|
IsCurrent
Gets or sets whether the item is current item.
Declaration
public bool IsCurrent { get; set; }
Property Value
System.Boolean
|
IsEnabledCore
True if the RadMenuItem can be selected; otherwise, false.
Declaration
protected override bool IsEnabledCore { get; }
Property Value
System.Boolean
|
IsHighlighted
Gets a value that indicates whether a RadMenuItem is highlighted. This is a dependency property.
Declaration
[SRCategory("Appearance")]
public bool IsHighlighted { get; protected set; }
Property Value
System.Boolean
|
IsSeparator
Gets or sets a value indicating whether this instance is a separator.
Declaration
public bool IsSeparator { get; set; }
Property Value
System.Boolean
|
IsSubmenuOpen
IsSuspendingPopupAnimation
Gets whether a menu suspends animations on its Popup control.
Declaration
public bool IsSuspendingPopupAnimation { get; }
Property Value
System.Boolean
|
ItemContainerTemplateSelector
Gets or sets the custom logic for choosing a template used to display each item.
Declaration
public DataTemplateSelector ItemContainerTemplateSelector { get; set; }
Property Value
System.Windows.Controls.DataTemplateSelector
|
Menu
Gets the RadMenu for this RadMenuItem. This is a readonly dependency property.
Declaration
public MenuBase Menu { get; }
Property Value
MenuBase
|
Role
Gets a value that indicates the role of a RadMenuItem. This is a dependency property.
Declaration
[SRCategory("Behavior")]
public MenuItemRole Role { get; }
Property Value
MenuItemRole
|
SeparatorTemplateKey
Gets the resource key for a style applied to a RadMenuItem when the RadMenuItem is a separator.
Declaration
[Obsolete("Since 2013 Q1 this property is not needed. Please use RadMenuSeparatorItem container and set its Template property.", false)]
public ControlTemplate SeparatorTemplateKey { get; set; }
Property Value
System.Windows.Controls.ControlTemplate
|
StaysOpenOnClick
Gets or sets a value that indicates that the submenu in which this RadMenuItem is located should not close when this item is clicked. This is a dependency property.
Declaration
[SRCategory("Behavior")]
public bool StaysOpenOnClick { get; set; }
Property Value
System.Boolean
|
SubmenuHeaderTemplateKey
SubmenuItemTemplateKey
TopLevelHeaderTemplateKey
Gets the resource key for a style applied to a RadMenuItem when the RadMenuItem is a header of a top-level menu.
Declaration
[Obsolete("Since 2013 Q1 this property is not needed. Please use RadMenuRootItem container and set its Template property.", false)]
public ControlTemplate TopLevelHeaderTemplateKey { get; set; }
Property Value
System.Windows.Controls.ControlTemplate
|
TopLevelItemTemplateKey
Gets the resource key for a style applied to a RadMenuItem when it is a top-level RadMenuItem.
Declaration
[Obsolete("Since 2013 Q1 this property is not needed. Please use RadMenuRootItem container and set its Template property.", false)]
public ControlTemplate TopLevelItemTemplateKey { get; set; }
Property Value
System.Windows.Controls.ControlTemplate
|
Methods
ChangeVisualState(Boolean)
Updates the visual state of the control.
Declaration
protected virtual void ChangeVisualState(bool useTransitions)
Parameters
System.Boolean
useTransitions
Indicates whether transitions should be used. |
ClearContainerForItemOverride(DependencyObject, Object)
Clear the Menu property.
Declaration
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameters
System.Windows.DependencyObject
element
Element used to display the specified item. |
System.Object
item
Specified item. |
GetContainerForItemOverride()
Creates or identifies the element that is used to display the given item.
Declaration
protected override DependencyObject GetContainerForItemOverride()
Returns
System.Windows.DependencyObject
|
IsItemItsOwnContainerOverride(Object)
Determines if the specified item is RadMenuItem.
Declaration
protected override sealed bool IsItemItsOwnContainerOverride(object item)
Parameters
System.Object
item
The item to check. |
Returns
System.Boolean
True if the item is RadMenuItem; otherwise, false. |
IsItemItsOwnContainerProtected(Object)
Determines if the specified item is RadMenuItem.
Declaration
protected virtual bool IsItemItsOwnContainerProtected(object item)
Parameters
System.Object
item
The item to check. |
Returns
System.Boolean
True if the item is RadMenuItem; otherwise, false. |
OnAccessKey(AccessKeyEventArgs)
Provides class handling for when an access key that is meaningful for this element is invoked.
Declaration
protected override void OnAccessKey(AccessKeyEventArgs e)
Parameters
System.Windows.Input.AccessKeyEventArgs
e
The event data to the access key event. The event data reports which key was invoked, and indicate whether the System.Windows.Input.AccessKeyManager object that controls the sending of these events also sent this access key invocation to other elements. |
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()
OnChecked(RoutedEventArgs)
Called when the IsChecked property becomes true.
Declaration
protected virtual void OnChecked(RoutedEventArgs e)
Parameters
System.Windows.RoutedEventArgs
e
The event data for the Checked event. |
OnClick()
Called when a RadMenuItem is clicked and raises a Click event.
Declaration
protected virtual void OnClick()
OnCreateAutomationPeer()
Provides an appropriate RadMenuItemAutomationPeer implementation for this control, as part of the automation infrastructure.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
System.Windows.Automation.Peers.AutomationPeer
|
OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)
Invoked when an unhandled Keyboard.GotKeyboardFocus attached event reaches an element in its route that is derived from this class.
Declaration
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
Parameters
System.Windows.Input.KeyboardFocusChangedEventArgs
e
The KeyboardFocusChangedEventArgs that contains the event data. |
OnHeaderChanged(Object, Object)
Declaration
protected override void OnHeaderChanged(object oldHeader, object newHeader)
Parameters
System.Object
oldHeader
|
System.Object
newHeader
|
OnHeaderTemplateChanged(DataTemplate, DataTemplate)
Declaration
protected override void OnHeaderTemplateChanged(DataTemplate oldHeaderTemplate, DataTemplate newHeaderTemplate)
Parameters
System.Windows.DataTemplate
oldHeaderTemplate
|
System.Windows.DataTemplate
newHeaderTemplate
|
OnHeaderTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector)
Declaration
protected override void OnHeaderTemplateSelectorChanged(DataTemplateSelector oldHeaderTemplateSelector, DataTemplateSelector newHeaderTemplateSelector)
Parameters
System.Windows.Controls.DataTemplateSelector
oldHeaderTemplateSelector
|
System.Windows.Controls.DataTemplateSelector
newHeaderTemplateSelector
|
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. |
OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
Called when the focus is no longer on or within a RadMenuItem.
Declaration
protected override void OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs e)
Parameters
System.Windows.DependencyPropertyChangedEventArgs
e
The event data for the System.Windows.UIElement.IsKeyboardFocusWithinChanged event. |
OnItemsChanged(NotifyCollectionChangedEventArgs)
Invoked when the System.Windows.Controls.ItemsControl.Items property changes.
Declaration
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameters
System.Collections.Specialized.NotifyCollectionChangedEventArgs
e
Information about the change. |
OnKeyDown(KeyEventArgs)
Raises the KeyDown event.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
System.Windows.Input.KeyEventArgs
e
The System.Windows.Input.KeyEventArgs instance containing the event data. |
OnMouseEnter(MouseEventArgs)
Raises the MouseEnter event.
Declaration
protected override void OnMouseEnter(MouseEventArgs e)
Parameters
System.Windows.Input.MouseEventArgs
e
The System.Windows.Input.MouseEventArgs instance containing the event data. |
OnMouseLeave(MouseEventArgs)
Raises the MouseLeave event.
Declaration
protected override void OnMouseLeave(MouseEventArgs e)
Parameters
System.Windows.Input.MouseEventArgs
e
The System.Windows.Input.MouseEventArgs instance containing the event data. |
OnMouseLeftButtonDown(MouseButtonEventArgs)
Raises the MouseLeftButtonDown event.
Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
System.Windows.Input.MouseButtonEventArgs
e
The System.Windows.Input.MouseButtonEventArgs instance containing the event data. |
OnMouseLeftButtonUp(MouseButtonEventArgs)
Raises the MouseLeftButtonUp event.
Declaration
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
System.Windows.Input.MouseButtonEventArgs
e
The System.Windows.Input.MouseButtonEventArgs instance containing the event data. |
OnMouseMove(MouseEventArgs)
Raises the MouseMove event.
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
System.Windows.Input.MouseEventArgs
e
The System.Windows.Input.MouseEventArgs instance containing the event data. |
OnMouseRightButtonDown(MouseButtonEventArgs)
Handles MouseRightButtonDown event.
Declaration
protected override void OnMouseRightButtonDown(MouseButtonEventArgs e)
Parameters
System.Windows.Input.MouseButtonEventArgs
e
The MouseButtonEventArgs that contains the event data. The event data reports that the right mouse button was pressed. |
OnMouseRightButtonUp(MouseButtonEventArgs)
Handles MouseRightButtonUp event.
Declaration
protected override void OnMouseRightButtonUp(MouseButtonEventArgs e)
Parameters
System.Windows.Input.MouseButtonEventArgs
e
The MouseButtonEventArgs that contains the event data. The event data reports that the right mouse button was released. |
OnSubmenuClosed(RadRoutedEventArgs)
OnSubmenuOpened(RadRoutedEventArgs)
OnUnchecked(RoutedEventArgs)
Called when the IsChecked property becomes false.
Declaration
protected virtual void OnUnchecked(RoutedEventArgs e)
Parameters
System.Windows.RoutedEventArgs
e
The event data for the Unchecked event. |
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. |
ResetTheme()
Resets the theme.
Declaration
public void ResetTheme()
Events
Checked
Occurs when a RadMenuItem is checked.
Declaration
[SRCategory("Behavior")]
public event RoutedEventHandler Checked
Event Type
System.Windows.RoutedEventHandler
|
Click
Occurs when a RadMenuItem is clicked.
Declaration
[SRCategory("Behavior")]
public event RadRoutedEventHandler Click
Event Type
RadRoutedEventHandler
|
SubmenuClosed
SubmenuOpened
Unchecked
Occurs when a RadMenuItem is unchecked.
Declaration
[SRCategory("Behavior")]
public event RoutedEventHandler Unchecked
Event Type
System.Windows.RoutedEventHandler
|