3 types derived from MenuItem
PresentationFramework (2)
MS\Internal\Documents\DocumentGridContextMenu.cs (1)
222private class EditorMenuItem : MenuItem
System\windows\Documents\TextEditorContextMenu.cs (1)
660private class EditorMenuItem : MenuItem
System.Windows.Controls.Ribbon (1)
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (1)
41public class RibbonMenuItem : MenuItem, ISyncKeyTipAndContent
14 instantiations of MenuItem
PresentationFramework (11)
MS\Internal\Documents\DocumentGridContextMenu.cs (6)
148SetMenuProperties(new MenuItem(), dg, ApplicationCommands.SelectAll); 153new MenuItem(), 160new MenuItem(), 167new MenuItem(), 174new MenuItem(), 182SetMenuProperties(new MenuItem(), dg, ApplicationCommands.Print);
System\Windows\Controls\MenuItem.cs (1)
2114return new MenuItem();
System\Windows\Controls\Primitives\MenuBase.cs (1)
510return new MenuItem();
System\Windows\Controls\Primitives\ScrollBar.cs (1)
884MenuItem menuItem = new MenuItem();
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
6831bamlType.DefaultConstructor = delegate() { return new System.Windows.Controls.MenuItem(); };
System\Windows\Markup\KnownTypes.cs (1)
1409case KnownElements.MenuItem: o = new System.Windows.Controls.MenuItem(); break;
PresentationUI (3)
MS\Internal\Documents\DocumentApplicationDocumentViewer.cs (3)
1088MenuItem menuItem = new MenuItem(); 1093menuItem = new MenuItem(); 1098menuItem = new MenuItem();
247 references to MenuItem
Microsoft.VisualStudio.LanguageServices (4)
artifacts\obj\Microsoft.VisualStudio.LanguageServices\Release\net472\InheritanceMargin\MarginGlyph\InheritanceMarginContextMenu.g.cs (3)
102eventSetter.Event = System.Windows.Controls.MenuItem.ClickEvent; 113eventSetter.Event = System.Windows.Controls.MenuItem.ClickEvent; 124eventSetter.Event = System.Windows.Controls.MenuItem.SubmenuOpenedEvent;
InheritanceMargin\MarginGlyph\InheritanceMarginContextMenu.xaml.cs (1)
50if (e.OriginalSource is MenuItem { DataContext: TargetMenuItemViewModel viewModel })
PresentationFramework (217)
MS\Internal\Documents\DocumentGridContextMenu.cs (2)
191private void SetMenuProperties(MenuItem menuItem, DocumentGrid dg, RoutedUICommand command) 196private void SetMenuProperties(MenuItem menuItem, DocumentGrid dg, RoutedUICommand command, string header, string inputGestureText)
System\Windows\Automation\Peers\MenuItemAutomationPeer.cs (25)
14public MenuItemAutomationPeer(MenuItem owner): base(owner) 34MenuItem owner = (MenuItem)Owner; 87MenuItem owner = (MenuItem)Owner; 119MenuItem owner = (MenuItem)Owner; 146MenuItem menuItem = (MenuItem)Owner; 197MenuItem owner = (MenuItem)Owner; 215MenuItem owner = (MenuItem)Owner; 224owner.SetCurrentValueInternal(MenuItem.IsSubmenuOpenProperty, MS.Internal.KnownBoxes.BooleanBoxes.FalseBox); 233MenuItem owner = (MenuItem)Owner; 255MenuItem owner = (MenuItem)Owner; 275MenuItem owner = (MenuItem)Owner; 282owner.SetCurrentValueInternal(MenuItem.IsCheckedProperty, MS.Internal.KnownBoxes.BooleanBoxes.Box(!owner.IsChecked)); 290MenuItem owner = (MenuItem)Owner; 323MenuItem menuItem = (MenuItem)Owner;
System\Windows\Controls\ContextMenu.cs (3)
392MenuItem.PrepareMenuItem(element, item); 461MenuItem.InsideContextMenuProperty.AddOwner(typeof(ContextMenu), 474MenuItem.SetInsideContextMenuProperty(this, true);
System\Windows\Controls\Menu.cs (5)
172MenuItem.PrepareMenuItem(element, item); 297MenuItem newSelection = info.Container as MenuItem; 344MenuItem menuItem = ItemContainerGenerator.ContainerFromIndex(i) as MenuItem;
System\Windows\Controls\MenuItem.cs (119)
61[StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(MenuItem))] 81_topLevelItemTemplateKey = new ComponentResourceKey(typeof(MenuItem), "TopLevelItemTemplateKey"); 97_topLevelHeaderTemplateKey = new ComponentResourceKey(typeof(MenuItem), "TopLevelHeaderTemplateKey"); 113_submenuItemTemplateKey = new ComponentResourceKey(typeof(MenuItem), "SubmenuItemTemplateKey"); 129_submenuHeaderTemplateKey = new ComponentResourceKey(typeof(MenuItem), "SubmenuHeaderTemplateKey"); 160HeaderProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(null, new CoerceValueCallback(CoerceHeader))); 162EventManager.RegisterClassHandler(typeof(MenuItem), AccessKeyManager.AccessKeyPressedEvent, new AccessKeyPressedEventHandler(OnAccessKeyPressed)); 163EventManager.RegisterClassHandler(typeof(MenuItem), MenuBase.IsSelectedChangedEvent, new RoutedPropertyChangedEventHandler<bool>(OnIsSelectedChanged)); 165ForegroundProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(SystemColors.MenuTextBrush)); 166FontFamilyProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(SystemFonts.MessageFontFamily)); 167FontSizeProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(SystemFonts.ThemeMessageFontSize)); 168FontStyleProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(SystemFonts.MessageFontStyle)); 169FontWeightProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(SystemFonts.MessageFontWeight)); 172ToolTipService.IsEnabledProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(null, new CoerceValueCallback(CoerceToolTipIsEnabled))); 178DefaultStyleKeyProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(typeof(MenuItem))); 179_dType = DependencyObjectType.FromSystemTypeInternal(typeof(MenuItem)); 181KeyboardNavigation.DirectionalNavigationProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(KeyboardNavigationMode.None)); 184FocusVisualStyleProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata((object)null /* default value */)); 190InputMethod.IsInputMethodSuspendedProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(BooleanBoxes.TrueBox, FrameworkPropertyMetadataOptions.Inherits)); 191AutomationProperties.IsOffscreenBehaviorProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(IsOffscreenBehavior.FromClip)); 207public static readonly RoutedEvent ClickEvent = EventManager.RegisterRoutedEvent("Click", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 217AddHandler(MenuItem.ClickEvent, value); 222RemoveHandler(MenuItem.ClickEvent, value); 230internal static readonly RoutedEvent PreviewClickEvent = EventManager.RegisterRoutedEvent("PreviewClick", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 235public static readonly RoutedEvent CheckedEvent = EventManager.RegisterRoutedEvent("Checked", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 240public static readonly RoutedEvent UncheckedEvent = EventManager.RegisterRoutedEvent("Unchecked", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 281EventManager.RegisterRoutedEvent("SubmenuOpened", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 287EventManager.RegisterRoutedEvent("SubmenuClosed", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 334MenuItem menuItem = (MenuItem)d; 378typeof(MenuItem), 396MenuItem item = (MenuItem) d; 434MenuItem.SetBoolField(this, BoolField.CanExecuteInvalid, false); 438MenuItem parent = ItemsControl.ItemsControlFromItemContainer(this) as MenuItem; 446MenuItem.SetBoolField(this, BoolField.CanExecuteInvalid, true); 478typeof(MenuItem), 496MenuItem item = (MenuItem)d; 507typeof(MenuItem), 529typeof(MenuItem), 550MenuItem mi = (MenuItem) d; 564MenuItem mi = (MenuItem) d; 589MenuItem menuItem = (MenuItem)d; 625MenuItem subItem = menuItem.ItemContainerGenerator.ContainerFromIndex(i) as MenuItem; 626if (subItem != null && MenuItem.GetBoolField(subItem, BoolField.CanExecuteInvalid)) 635MenuItem.SetBoolField(menuItem, BoolField.IgnoreMouseEvents, true); 636MenuItem.SetBoolField(menuItem, BoolField.MouseEnterOnMouseMove, false); 644MenuItem.SetBoolField(menuItem, BoolField.IgnoreMouseEvents, false); 699MenuItem.SetBoolField(menuItem, BoolField.IgnoreNextMouseLeave, true); 745typeof(MenuItem), 804typeof(MenuItem), 821((MenuItem) target).UpdateRole(); 833typeof(MenuItem), 876typeof(MenuItem), 906typeof(MenuItem), 945MenuItem menuItem = (MenuItem) d; 975typeof(MenuItem), 1004typeof(MenuItem), 1012MenuItem menuItem = (MenuItem)d; 1047MenuItem menuItem = (MenuItem)sender; 1048MenuItem source = e.OriginalSource as MenuItem; 1100typeof(MenuItem), 1125MenuItem menuItem = (MenuItem)d; 1157typeof(MenuItem), 1172= DependencyProperty.RegisterReadOnly("IsSuspendingPopupAnimation", typeof(bool), typeof(MenuItem), 1203bool openedWithKeyboard = MenuItem.GetBoolField(this, BoolField.OpenedWithKeyboard); 1207MenuItem ignore = openedWithKeyboard ? null : this; 1219((MenuItem)arg).IsSuspendingPopupAnimation = true; 1226MenuItem.SetBoolField(this, BoolField.OpenedWithKeyboard, false); 1242typeof(MenuItem), 1258MenuBase.UsesItemContainerTemplateProperty.AddOwner(typeof(MenuItem)); 1307MenuItem.PrepareMenuItem(element, item); 1315MenuItem menuItem = element as MenuItem; 1327if (MenuItem.GetBoolField(menuItem, BoolField.CanExecuteInvalid)) 1377RaiseEvent(new RoutedEventArgs(MenuItem.PreviewClickEvent, this)); 1399RaiseEvent(new RoutedEventArgs(MenuItem.ClickEvent, this)); 1542MenuItem menuItem = sender as MenuItem; 1574if (e.Target != menuItem && e.Target is MenuItem) 1656MenuItem parent = ItemsControl.ItemsControlFromItemContainer(this) as MenuItem; 1658MenuItem.GetBoolField(parent, BoolField.MouseEnterOnMouseMove)) 1660MenuItem.SetBoolField(parent, BoolField.MouseEnterOnMouseMove, false); 1680if (parent == null || !MenuItem.GetBoolField(parent, BoolField.IgnoreMouseEvents)) 1705else if (parent is MenuItem) 1707MenuItem.SetBoolField(parent, BoolField.MouseEnterOnMouseMove, true); 1733MenuItem sibling = CurrentSibling; 1783if (MenuItem.GetBoolField(this, BoolField.IgnoreNextMouseLeave)) 1787MenuItem.SetBoolField(this, BoolField.IgnoreNextMouseLeave, false); 1994if ((parent != null) && (!MenuItem.GetBoolField(parent, BoolField.IgnoreMouseEvents))) 1997MenuItem.SetBoolField(parent, BoolField.IgnoreMouseEvents, true); 2003MenuItem.SetBoolField(parent, BoolField.IgnoreMouseEvents, false); 2067bool ret = (item is MenuItem) || (item is Separator); 2103if (itemContainer is MenuItem || itemContainer is Separator) 2109throw new InvalidOperationException(SR.Format(SR.InvalidItemContainer, this.GetType().Name, typeof(MenuItem).Name, typeof(Separator).Name, itemContainer)); 2240= DependencyProperty.RegisterAttached("InsideContextMenu", typeof(bool), typeof(MenuItem), 2312if ((owner != null) && ((owner is MenuItem) || (owner is MenuBase))) 2329MenuItem.SetBoolField(this, BoolField.OpenedWithKeyboard, true); 2401private MenuItem CurrentSibling 2406MenuItem menuItemParent = parent as MenuItem; 2407MenuItem sibling = null; 2590string inputGestureText = ((MenuItem)d).InputGestureText; 2614private MenuItem CurrentSelection 2651typeof(MenuItem), 2707private MenuItem _currentSelection;
System\Windows\Controls\Primitives\MenuBase.cs (19)
20[StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(MenuItem))] 45EventManager.RegisterClassHandler(typeof(MenuBase), MenuItem.PreviewClickEvent, new RoutedEventHandler(OnMenuItemPreviewClick)); 330MenuItem newSelectedMenuItem = e.OriginalSource as MenuItem; 348menu.CurrentSelection.SetCurrentValueInternal(MenuItem.IsSubmenuOpenProperty, BooleanBoxes.FalseBox); 361menu.CurrentSelection.SetCurrentValueInternal(MenuItem.IsSubmenuOpenProperty, BooleanBoxes.Box(wasSubmenuOpen)); 446CurrentSelection.SetCurrentValueInternal(MenuItem.IsSubmenuOpenProperty, BooleanBoxes.FalseBox); 479bool ret = (item is MenuItem) || (item is Separator); 499if (itemContainer is MenuItem || itemContainer is Separator) 505throw new InvalidOperationException(SR.Format(SR.InvalidItemContainer, this.GetType().Name, typeof(MenuItem).Name, typeof(Separator).Name, itemContainer)); 575MenuItem menuItemSource = e.OriginalSource as MenuItem; 679internal static void SetSuspendingPopupAnimation(ItemsControl menu, MenuItem ignore, bool suspend) 688MenuItem mi = menu.ItemContainerGenerator.ContainerFromIndex(i) as MenuItem; 741internal MenuItem CurrentSelection 755_currentSelection.SetCurrentValueInternal(MenuItem.IsSelectedProperty, BooleanBoxes.FalseBox); 761_currentSelection.SetCurrentValueInternal(MenuItem.IsSelectedProperty, BooleanBoxes.TrueBox); 931private MenuItem _currentSelection;
System\Windows\Controls\Primitives\Popup.cs (1)
2672|| (this.TemplatedParent is MenuItem))
System\Windows\Controls\Primitives\ScrollBar.cs (3)
882private static MenuItem CreateMenuItem(string name, string automationId, RoutedCommand command) 884MenuItem menuItem = new MenuItem(); 893menuItem.SetBinding(MenuItem.CommandTargetProperty, binding);
System\Windows\Controls\StickyNote.cs (23)
59[TemplatePart(Name = SNBConstants.c_CopyMenuId, Type = typeof(MenuItem))] 60[TemplatePart(Name = SNBConstants.c_PasteMenuId, Type = typeof(MenuItem))] 61[TemplatePart(Name = SNBConstants.c_InkMenuId, Type = typeof(MenuItem))] 62[TemplatePart(Name = SNBConstants.c_SelectMenuId, Type = typeof(MenuItem))] 63[TemplatePart(Name = SNBConstants.c_EraseMenuId, Type = typeof(MenuItem))] 1632MenuItem inkMenuItem = GetInkMenuItem(); 1641inkMenuItem.SetBinding(MenuItem.IsCheckedProperty, checkedBind); 1644MenuItem selectMenuItem = GetSelectMenuItem(); 1653selectMenuItem.SetBinding(MenuItem.IsCheckedProperty, checkedBind); 1656MenuItem eraseMenuItem = GetEraseMenuItem(); 1665eraseMenuItem.SetBinding(MenuItem.IsCheckedProperty, checkedBind); 1669MenuItem copyMenuItem = GetCopyMenuItem(); 1675MenuItem pasteMenuItem = GetPasteMenuItem(); 1798private MenuItem GetInkMenuItem() 1800return GetTemplateChild(SNBConstants.c_InkMenuId) as MenuItem; 1806private MenuItem GetSelectMenuItem() 1808return GetTemplateChild(SNBConstants.c_SelectMenuId) as MenuItem; 1814private MenuItem GetEraseMenuItem() 1816return GetTemplateChild(SNBConstants.c_EraseMenuId) as MenuItem; 1822private MenuItem GetCopyMenuItem() 1824return GetTemplateChild(SNBConstants.c_CopyMenuId) as MenuItem; 1830private MenuItem GetPasteMenuItem() 1832return GetTemplateChild(SNBConstants.c_PasteMenuId) as MenuItem;
System\windows\Documents\TextEditorContextMenu.cs (3)
479MenuItem menuItem; 543MenuItem menuItem; 602MenuItem menuItem;
System\Windows\Markup\Baml2006\Baml2006KnownTypes.cs (1)
497case 403: t = () => typeof(MenuItem); break;
System\Windows\Markup\Baml2006\WpfGeneratedKnownProperties.cs (9)
5173Type type = typeof(System.Windows.Controls.MenuItem); 5175this.GetXamlType(typeof(System.Windows.Controls.MenuItem)), // DeclaringType 5181bamlMember.GetDelegate = delegate(object target) { return ((System.Windows.Controls.MenuItem)target).Items; }; 7450Type type = typeof(System.Windows.Controls.MenuItem); 7451DependencyProperty dp = System.Windows.Controls.MenuItem.RoleProperty; 7453this.GetXamlType(typeof(System.Windows.Controls.MenuItem)), // DeclaringType 8111Type type = typeof(System.Windows.Controls.MenuItem); 8112DependencyProperty dp = System.Windows.Controls.MenuItem.IsCheckedProperty; 8114this.GetXamlType(typeof(System.Windows.Controls.MenuItem)), // DeclaringType
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
6829typeof(System.Windows.Controls.MenuItem),
System\Windows\Markup\KnownTypes.cs (1)
5957case KnownElements.MenuItem: t = typeof(System.Windows.Controls.MenuItem); break;
System\Windows\SystemKeyConverter.cs (1)
183return typeof(MenuItem);
System\Windows\SystemResourceKey.cs (1)
1823return MenuItem.SeparatorStyleKey;
PresentationUI (18)
artifacts\obj\PresentationUI\x86\Debug\net10.0\MS\Internal\Documents\FindToolBar.g.cs (12)
114internal System.Windows.Controls.MenuItem OptionsMenuItem; 122internal System.Windows.Controls.MenuItem OptionsWholeWordMenuItem; 130internal System.Windows.Controls.MenuItem OptionsCaseMenuItem; 138internal System.Windows.Controls.MenuItem OptionsDiacriticMenuItem; 146internal System.Windows.Controls.MenuItem OptionsKashidaMenuItem; 154internal System.Windows.Controls.MenuItem OptionsAlefHamzaMenuItem; 241this.OptionsMenuItem = ((System.Windows.Controls.MenuItem)(target)); 244this.OptionsWholeWordMenuItem = ((System.Windows.Controls.MenuItem)(target)); 247this.OptionsCaseMenuItem = ((System.Windows.Controls.MenuItem)(target)); 250this.OptionsDiacriticMenuItem = ((System.Windows.Controls.MenuItem)(target)); 253this.OptionsKashidaMenuItem = ((System.Windows.Controls.MenuItem)(target)); 256this.OptionsAlefHamzaMenuItem = ((System.Windows.Controls.MenuItem)(target));
MS\Internal\Documents\DocumentApplicationDocumentViewer.cs (6)
917private MenuItem DigitalSignaturesMenuItem 924_digitalSignaturesMenuItem = GetTemplateChild(_digitalSignaturesMenuItemName) as MenuItem; 1088MenuItem menuItem = new MenuItem(); 1242MenuItem menuItem = sender as MenuItem; 2221private MenuItem _digitalSignaturesMenuItem;
System.Windows.Controls.Ribbon (8)
Microsoft\Windows\Controls\Ribbon\RibbonContextMenu.cs (2)
552separator.SetResourceReference(StyleProperty, MenuItem.SeparatorStyleKey); 554separator.DefaultStyleKeyInternal = MenuItem.SeparatorStyleKey;
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (1)
2277markupProp.DependencyProperty == MenuItem.IsSubmenuOpenProperty)
Microsoft\Windows\Controls\Ribbon\RibbonMenuButton.cs (2)
581separator.SetResourceReference(StyleProperty, MenuItem.SeparatorStyleKey); 583separator.DefaultStyleKeyInternal = MenuItem.SeparatorStyleKey;
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (2)
556separator.SetResourceReference(StyleProperty, MenuItem.SeparatorStyleKey); 558separator.DefaultStyleKeyInternal = MenuItem.SeparatorStyleKey;
Microsoft\Windows\Controls\Ribbon\RibbonSplitButton.cs (1)
243public static readonly RoutedEvent ClickEvent = MenuItem.ClickEvent.AddOwner(typeof(RibbonSplitButton));