3 types derived from MenuItem
PresentationFramework (2)
MS\Internal\Documents\DocumentGridContextMenu.cs (1)
230private class EditorMenuItem : MenuItem
System\windows\Documents\TextEditorContextMenu.cs (1)
673private class EditorMenuItem : MenuItem
System.Windows.Controls.Ribbon (1)
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (1)
44public class RibbonMenuItem : MenuItem, ISyncKeyTipAndContent
14 instantiations of MenuItem
PresentationFramework (11)
MS\Internal\Documents\DocumentGridContextMenu.cs (6)
156SetMenuProperties(new MenuItem(), dg, ApplicationCommands.SelectAll); 161new MenuItem(), 168new MenuItem(), 175new MenuItem(), 182new MenuItem(), 190SetMenuProperties(new MenuItem(), dg, ApplicationCommands.Print);
System\Windows\Controls\MenuItem.cs (1)
2124return new MenuItem();
System\Windows\Controls\Primitives\MenuBase.cs (1)
519return new MenuItem();
System\Windows\Controls\Primitives\ScrollBar.cs (1)
900MenuItem menuItem = new MenuItem();
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
6833bamlType.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)
1095MenuItem menuItem = new MenuItem(); 1100menuItem = new MenuItem(); 1105menuItem = 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)
199private void SetMenuProperties(MenuItem menuItem, DocumentGrid dg, RoutedUICommand command) 204private void SetMenuProperties(MenuItem menuItem, DocumentGrid dg, RoutedUICommand command, string header, string inputGestureText)
System\Windows\Automation\Peers\MenuItemAutomationPeer.cs (25)
27public MenuItemAutomationPeer(MenuItem owner): base(owner) 47MenuItem owner = (MenuItem)Owner; 100MenuItem owner = (MenuItem)Owner; 132MenuItem owner = (MenuItem)Owner; 159MenuItem menuItem = (MenuItem)Owner; 210MenuItem owner = (MenuItem)Owner; 228MenuItem owner = (MenuItem)Owner; 237owner.SetCurrentValueInternal(MenuItem.IsSubmenuOpenProperty, MS.Internal.KnownBoxes.BooleanBoxes.FalseBox); 246MenuItem owner = (MenuItem)Owner; 268MenuItem owner = (MenuItem)Owner; 288MenuItem owner = (MenuItem)Owner; 295owner.SetCurrentValueInternal(MenuItem.IsCheckedProperty, MS.Internal.KnownBoxes.BooleanBoxes.Box(!owner.IsChecked)); 303MenuItem owner = (MenuItem)Owner; 336MenuItem menuItem = (MenuItem)Owner;
System\Windows\Controls\ContextMenu.cs (3)
400MenuItem.PrepareMenuItem(element, item); 469MenuItem.InsideContextMenuProperty.AddOwner(typeof(ContextMenu), 482MenuItem.SetInsideContextMenuProperty(this, true);
System\Windows\Controls\Menu.cs (5)
182MenuItem.PrepareMenuItem(element, item); 307MenuItem newSelection = info.Container as MenuItem; 354MenuItem menuItem = ItemContainerGenerator.ContainerFromIndex(i) as MenuItem;
System\Windows\Controls\MenuItem.cs (119)
71[StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(MenuItem))] 91_topLevelItemTemplateKey = new ComponentResourceKey(typeof(MenuItem), "TopLevelItemTemplateKey"); 107_topLevelHeaderTemplateKey = new ComponentResourceKey(typeof(MenuItem), "TopLevelHeaderTemplateKey"); 123_submenuItemTemplateKey = new ComponentResourceKey(typeof(MenuItem), "SubmenuItemTemplateKey"); 139_submenuHeaderTemplateKey = new ComponentResourceKey(typeof(MenuItem), "SubmenuHeaderTemplateKey"); 170HeaderProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(null, new CoerceValueCallback(CoerceHeader))); 172EventManager.RegisterClassHandler(typeof(MenuItem), AccessKeyManager.AccessKeyPressedEvent, new AccessKeyPressedEventHandler(OnAccessKeyPressed)); 173EventManager.RegisterClassHandler(typeof(MenuItem), MenuBase.IsSelectedChangedEvent, new RoutedPropertyChangedEventHandler<bool>(OnIsSelectedChanged)); 175ForegroundProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(SystemColors.MenuTextBrush)); 176FontFamilyProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(SystemFonts.MessageFontFamily)); 177FontSizeProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(SystemFonts.ThemeMessageFontSize)); 178FontStyleProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(SystemFonts.MessageFontStyle)); 179FontWeightProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(SystemFonts.MessageFontWeight)); 182ToolTipService.IsEnabledProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(null, new CoerceValueCallback(CoerceToolTipIsEnabled))); 188DefaultStyleKeyProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(typeof(MenuItem))); 189_dType = DependencyObjectType.FromSystemTypeInternal(typeof(MenuItem)); 191KeyboardNavigation.DirectionalNavigationProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(KeyboardNavigationMode.None)); 194FocusVisualStyleProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata((object)null /* default value */)); 200InputMethod.IsInputMethodSuspendedProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(BooleanBoxes.TrueBox, FrameworkPropertyMetadataOptions.Inherits)); 201AutomationProperties.IsOffscreenBehaviorProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(IsOffscreenBehavior.FromClip)); 217public static readonly RoutedEvent ClickEvent = EventManager.RegisterRoutedEvent("Click", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 227AddHandler(MenuItem.ClickEvent, value); 232RemoveHandler(MenuItem.ClickEvent, value); 240internal static readonly RoutedEvent PreviewClickEvent = EventManager.RegisterRoutedEvent("PreviewClick", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 245public static readonly RoutedEvent CheckedEvent = EventManager.RegisterRoutedEvent("Checked", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 250public static readonly RoutedEvent UncheckedEvent = EventManager.RegisterRoutedEvent("Unchecked", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 291EventManager.RegisterRoutedEvent("SubmenuOpened", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 297EventManager.RegisterRoutedEvent("SubmenuClosed", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 344MenuItem menuItem = (MenuItem)d; 388typeof(MenuItem), 406MenuItem item = (MenuItem) d; 444MenuItem.SetBoolField(this, BoolField.CanExecuteInvalid, false); 448MenuItem parent = ItemsControl.ItemsControlFromItemContainer(this) as MenuItem; 456MenuItem.SetBoolField(this, BoolField.CanExecuteInvalid, true); 488typeof(MenuItem), 506MenuItem item = (MenuItem)d; 517typeof(MenuItem), 539typeof(MenuItem), 560MenuItem mi = (MenuItem) d; 574MenuItem mi = (MenuItem) d; 599MenuItem menuItem = (MenuItem)d; 635MenuItem subItem = menuItem.ItemContainerGenerator.ContainerFromIndex(i) as MenuItem; 636if (subItem != null && MenuItem.GetBoolField(subItem, BoolField.CanExecuteInvalid)) 645MenuItem.SetBoolField(menuItem, BoolField.IgnoreMouseEvents, true); 646MenuItem.SetBoolField(menuItem, BoolField.MouseEnterOnMouseMove, false); 654MenuItem.SetBoolField(menuItem, BoolField.IgnoreMouseEvents, false); 709MenuItem.SetBoolField(menuItem, BoolField.IgnoreNextMouseLeave, true); 755typeof(MenuItem), 814typeof(MenuItem), 831((MenuItem) target).UpdateRole(); 843typeof(MenuItem), 886typeof(MenuItem), 916typeof(MenuItem), 955MenuItem menuItem = (MenuItem) d; 985typeof(MenuItem), 1014typeof(MenuItem), 1022MenuItem menuItem = (MenuItem)d; 1057MenuItem menuItem = (MenuItem)sender; 1058MenuItem source = e.OriginalSource as MenuItem; 1110typeof(MenuItem), 1135MenuItem menuItem = (MenuItem)d; 1167typeof(MenuItem), 1182= DependencyProperty.RegisterReadOnly("IsSuspendingPopupAnimation", typeof(bool), typeof(MenuItem), 1213bool openedWithKeyboard = MenuItem.GetBoolField(this, BoolField.OpenedWithKeyboard); 1217MenuItem ignore = openedWithKeyboard ? null : this; 1229((MenuItem)arg).IsSuspendingPopupAnimation = true; 1236MenuItem.SetBoolField(this, BoolField.OpenedWithKeyboard, false); 1252typeof(MenuItem), 1268MenuBase.UsesItemContainerTemplateProperty.AddOwner(typeof(MenuItem)); 1317MenuItem.PrepareMenuItem(element, item); 1325MenuItem menuItem = element as MenuItem; 1337if (MenuItem.GetBoolField(menuItem, BoolField.CanExecuteInvalid)) 1387RaiseEvent(new RoutedEventArgs(MenuItem.PreviewClickEvent, this)); 1409RaiseEvent(new RoutedEventArgs(MenuItem.ClickEvent, this)); 1552MenuItem menuItem = sender as MenuItem; 1584if (e.Target != menuItem && e.Target is MenuItem) 1666MenuItem parent = ItemsControl.ItemsControlFromItemContainer(this) as MenuItem; 1668MenuItem.GetBoolField(parent, BoolField.MouseEnterOnMouseMove)) 1670MenuItem.SetBoolField(parent, BoolField.MouseEnterOnMouseMove, false); 1690if (parent == null || !MenuItem.GetBoolField(parent, BoolField.IgnoreMouseEvents)) 1715else if (parent is MenuItem) 1717MenuItem.SetBoolField(parent, BoolField.MouseEnterOnMouseMove, true); 1743MenuItem sibling = CurrentSibling; 1793if (MenuItem.GetBoolField(this, BoolField.IgnoreNextMouseLeave)) 1797MenuItem.SetBoolField(this, BoolField.IgnoreNextMouseLeave, false); 2004if ((parent != null) && (!MenuItem.GetBoolField(parent, BoolField.IgnoreMouseEvents))) 2007MenuItem.SetBoolField(parent, BoolField.IgnoreMouseEvents, true); 2013MenuItem.SetBoolField(parent, BoolField.IgnoreMouseEvents, false); 2077bool ret = (item is MenuItem) || (item is Separator); 2113if (itemContainer is MenuItem || itemContainer is Separator) 2119throw new InvalidOperationException(SR.Format(SR.InvalidItemContainer, this.GetType().Name, typeof(MenuItem).Name, typeof(Separator).Name, itemContainer)); 2250= DependencyProperty.RegisterAttached("InsideContextMenu", typeof(bool), typeof(MenuItem), 2322if ((owner != null) && ((owner is MenuItem) || (owner is MenuBase))) 2339MenuItem.SetBoolField(this, BoolField.OpenedWithKeyboard, true); 2411private MenuItem CurrentSibling 2416MenuItem menuItemParent = parent as MenuItem; 2417MenuItem sibling = null; 2600string inputGestureText = ((MenuItem)d).InputGestureText; 2624private MenuItem CurrentSelection 2661typeof(MenuItem), 2717private MenuItem _currentSelection;
System\Windows\Controls\Primitives\MenuBase.cs (19)
29[StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(MenuItem))] 54EventManager.RegisterClassHandler(typeof(MenuBase), MenuItem.PreviewClickEvent, new RoutedEventHandler(OnMenuItemPreviewClick)); 339MenuItem newSelectedMenuItem = e.OriginalSource as MenuItem; 357menu.CurrentSelection.SetCurrentValueInternal(MenuItem.IsSubmenuOpenProperty, BooleanBoxes.FalseBox); 370menu.CurrentSelection.SetCurrentValueInternal(MenuItem.IsSubmenuOpenProperty, BooleanBoxes.Box(wasSubmenuOpen)); 455CurrentSelection.SetCurrentValueInternal(MenuItem.IsSubmenuOpenProperty, BooleanBoxes.FalseBox); 488bool ret = (item is MenuItem) || (item is Separator); 508if (itemContainer is MenuItem || itemContainer is Separator) 514throw new InvalidOperationException(SR.Format(SR.InvalidItemContainer, this.GetType().Name, typeof(MenuItem).Name, typeof(Separator).Name, itemContainer)); 584MenuItem menuItemSource = e.OriginalSource as MenuItem; 688internal static void SetSuspendingPopupAnimation(ItemsControl menu, MenuItem ignore, bool suspend) 697MenuItem mi = menu.ItemContainerGenerator.ContainerFromIndex(i) as MenuItem; 750internal MenuItem CurrentSelection 764_currentSelection.SetCurrentValueInternal(MenuItem.IsSelectedProperty, BooleanBoxes.FalseBox); 770_currentSelection.SetCurrentValueInternal(MenuItem.IsSelectedProperty, BooleanBoxes.TrueBox); 940private MenuItem _currentSelection;
System\Windows\Controls\Primitives\Popup.cs (1)
2679|| (this.TemplatedParent is MenuItem))
System\Windows\Controls\Primitives\ScrollBar.cs (3)
898private static MenuItem CreateMenuItem(string name, string automationId, RoutedCommand command) 900MenuItem menuItem = new MenuItem(); 909menuItem.SetBinding(MenuItem.CommandTargetProperty, binding);
System\Windows\Controls\StickyNote.cs (23)
75[TemplatePart(Name = SNBConstants.c_CopyMenuId, Type = typeof(MenuItem))] 76[TemplatePart(Name = SNBConstants.c_PasteMenuId, Type = typeof(MenuItem))] 77[TemplatePart(Name = SNBConstants.c_InkMenuId, Type = typeof(MenuItem))] 78[TemplatePart(Name = SNBConstants.c_SelectMenuId, Type = typeof(MenuItem))] 79[TemplatePart(Name = SNBConstants.c_EraseMenuId, Type = typeof(MenuItem))] 1648MenuItem inkMenuItem = GetInkMenuItem(); 1657inkMenuItem.SetBinding(MenuItem.IsCheckedProperty, checkedBind); 1660MenuItem selectMenuItem = GetSelectMenuItem(); 1669selectMenuItem.SetBinding(MenuItem.IsCheckedProperty, checkedBind); 1672MenuItem eraseMenuItem = GetEraseMenuItem(); 1681eraseMenuItem.SetBinding(MenuItem.IsCheckedProperty, checkedBind); 1685MenuItem copyMenuItem = GetCopyMenuItem(); 1691MenuItem pasteMenuItem = GetPasteMenuItem(); 1814private MenuItem GetInkMenuItem() 1816return GetTemplateChild(SNBConstants.c_InkMenuId) as MenuItem; 1822private MenuItem GetSelectMenuItem() 1824return GetTemplateChild(SNBConstants.c_SelectMenuId) as MenuItem; 1830private MenuItem GetEraseMenuItem() 1832return GetTemplateChild(SNBConstants.c_EraseMenuId) as MenuItem; 1838private MenuItem GetCopyMenuItem() 1840return GetTemplateChild(SNBConstants.c_CopyMenuId) as MenuItem; 1846private MenuItem GetPasteMenuItem() 1848return GetTemplateChild(SNBConstants.c_PasteMenuId) as MenuItem;
System\windows\Documents\TextEditorContextMenu.cs (3)
481MenuItem menuItem; 545MenuItem menuItem; 604MenuItem menuItem;
System\Windows\Markup\Baml2006\Baml2006KnownTypes.cs (1)
499case 403: t = () => typeof(MenuItem); break;
System\Windows\Markup\Baml2006\WpfGeneratedKnownProperties.cs (9)
5175Type type = typeof(System.Windows.Controls.MenuItem); 5177this.GetXamlType(typeof(System.Windows.Controls.MenuItem)), // DeclaringType 5183bamlMember.GetDelegate = delegate(object target) { return ((System.Windows.Controls.MenuItem)target).Items; }; 7452Type type = typeof(System.Windows.Controls.MenuItem); 7453DependencyProperty dp = System.Windows.Controls.MenuItem.RoleProperty; 7455this.GetXamlType(typeof(System.Windows.Controls.MenuItem)), // DeclaringType 8113Type type = typeof(System.Windows.Controls.MenuItem); 8114DependencyProperty dp = System.Windows.Controls.MenuItem.IsCheckedProperty; 8116this.GetXamlType(typeof(System.Windows.Controls.MenuItem)), // DeclaringType
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
6831typeof(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)
185return typeof(MenuItem);
System\Windows\SystemResourceKey.cs (1)
1823return MenuItem.SeparatorStyleKey;
PresentationUI (18)
artifacts\obj\PresentationUI\Debug\net9.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)
924private MenuItem DigitalSignaturesMenuItem 931_digitalSignaturesMenuItem = GetTemplateChild(_digitalSignaturesMenuItemName) as MenuItem; 1095MenuItem menuItem = new MenuItem(); 1249MenuItem menuItem = sender as MenuItem; 2228private MenuItem _digitalSignaturesMenuItem;
System.Windows.Controls.Ribbon (8)
Microsoft\Windows\Controls\Ribbon\RibbonContextMenu.cs (2)
554separator.SetResourceReference(StyleProperty, MenuItem.SeparatorStyleKey); 556separator.DefaultStyleKeyInternal = MenuItem.SeparatorStyleKey;
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (1)
2282markupProp.DependencyProperty == MenuItem.IsSubmenuOpenProperty)
Microsoft\Windows\Controls\Ribbon\RibbonMenuButton.cs (2)
584separator.SetResourceReference(StyleProperty, MenuItem.SeparatorStyleKey); 586separator.DefaultStyleKeyInternal = MenuItem.SeparatorStyleKey;
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (2)
559separator.SetResourceReference(StyleProperty, MenuItem.SeparatorStyleKey); 561separator.DefaultStyleKeyInternal = MenuItem.SeparatorStyleKey;
Microsoft\Windows\Controls\Ribbon\RibbonSplitButton.cs (1)
245public static readonly RoutedEvent ClickEvent = MenuItem.ClickEvent.AddOwner(typeof(RibbonSplitButton));