Class RadMenuItem
Represents a selectable item inside a RadMenu or RadContextMenu.
Inherited Members
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.Navigation.dll
Syntax
[TelerikToolboxCategory("Navigation")]
public class RadMenuItem : HeaderedItemsControl, ICommandSource, ISupportInitialize
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
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
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
|
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
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
public static readonly DependencyProperty TopLevelHeaderTemplateKeyProperty
Field Value
System.Windows.DependencyProperty
|
TopLevelItemTemplateKeyProperty
Identifies the TopLevelItemTemplateKey dependency property.
Declaration
public static readonly DependencyProperty TopLevelItemTemplateKeyProperty
Field Value
System.Windows.DependencyProperty
|
UncheckedEvent
Identifies the Unchecked routed event.
Declaration
public static readonly RoutedEvent UncheckedEvent
Field Value
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
|
Implements
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
|
Implements
CommandTarget
The object that the command is being executed on.
Declaration
public UIElement CommandTarget { get; set; }
Property Value
System.Windows.UIElement
|
Implements
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
|
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
|
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
|
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
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
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
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
public ControlTemplate TopLevelItemTemplateKey { get; set; }
Property Value
System.Windows.Controls.ControlTemplate
|
Methods
add_Click(RadRoutedEventHandler)
Declaration
public void add_Click(RadRoutedEventHandler value)
Parameters
RadRoutedEventHandler
value
|
add_SubmenuClosed(RadRoutedEventHandler)
add_SubmenuOpened(RadRoutedEventHandler)
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)
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. |
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
OnChecked(RadRoutedEventArgs)
Called when the IsChecked property becomes true.
Declaration
protected virtual void OnChecked(RadRoutedEventArgs e)
Parameters
RadRoutedEventArgs
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
|
OnHeaderChanged(Object, Object)
Called when the Header property of a HeaderedItemsControl changes.
Declaration
protected override void OnHeaderChanged(object oldHeader, object newHeader)
Parameters
System.Object
oldHeader
The old value of the Header property. |
System.Object
newHeader
The new value of the Header property. |
Overrides
OnHeaderTemplateChanged(DataTemplate, DataTemplate)
Called when the HeaderTemplate property of a HeaderedItemsControl changes.
Declaration
protected override void OnHeaderTemplateChanged(DataTemplate oldHeaderTemplate, DataTemplate newHeaderTemplate)
Parameters
System.Windows.DataTemplate
oldHeaderTemplate
The old value of the HeaderTemplate property. |
System.Windows.DataTemplate
newHeaderTemplate
The new value of the HeaderTemplate property. |
Overrides
OnHeaderTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector)
Called when the HeaderTemplateSelector property of a HeaderedItemsControl changes.
Declaration
protected override void OnHeaderTemplateSelectorChanged(DataTemplateSelector oldHeaderTemplateSelector, DataTemplateSelector newHeaderTemplateSelector)
Parameters
DataTemplateSelector
oldHeaderTemplateSelector
The old value of the HeaderTemplateSelector property. |
DataTemplateSelector
newHeaderTemplateSelector
The new value of the HeaderTemplateSelector property. |
Overrides
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. |
Overrides
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. |
OnKeyUp(KeyEventArgs)
Raises the KeyUp event.
Declaration
protected override void OnKeyUp(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(RadRoutedEventArgs)
Called when the IsChecked property becomes false.
Declaration
protected virtual void OnUnchecked(RadRoutedEventArgs e)
Parameters
RadRoutedEventArgs
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. |
Overrides
remove_Click(RadRoutedEventHandler)
Declaration
public void remove_Click(RadRoutedEventHandler value)
Parameters
RadRoutedEventHandler
value
|
remove_SubmenuClosed(RadRoutedEventHandler)
remove_SubmenuOpened(RadRoutedEventHandler)
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
|