2 types derived from MenuItem
PresentationFramework (2)
src\Framework\MS\Internal\Documents\DocumentGridContextMenu.cs (1)
262private class EditorMenuItem : MenuItem
src\Framework\System\windows\Documents\TextEditorContextMenu.cs (1)
737private class EditorMenuItem : MenuItem
12 instantiations of MenuItem
PresentationFramework (11)
src\Framework\MS\Internal\Documents\DocumentGridContextMenu.cs (6)
188SetMenuProperties(new MenuItem(), dg, ApplicationCommands.SelectAll); 193new MenuItem(), 200new MenuItem(), 207new MenuItem(), 214new MenuItem(), 222SetMenuProperties(new MenuItem(), dg, ApplicationCommands.Print);
src\Framework\System\Windows\Controls\MenuItem.cs (1)
2172return new MenuItem();
src\Framework\System\Windows\Controls\Primitives\MenuBase.cs (1)
523return new MenuItem();
src\Framework\System\Windows\Controls\Primitives\ScrollBar.cs (1)
905MenuItem menuItem = new MenuItem();
src\Framework\System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
6829bamlType.DefaultConstructor = delegate() { return new System.Windows.Controls.MenuItem(); };
src\Framework\System\Windows\Markup\KnownTypes.cs (1)
1410case KnownElements.MenuItem: o = new System.Windows.Controls.MenuItem(); break;
System.Activities.Core.Presentation (1)
System\Activities\Core\Presentation\FlowchartDesigner.xaml.cs (1)
226setAsStartNode = new MenuItem();
273 references to MenuItem
PresentationFramework (215)
src\Framework\MS\Internal\Documents\DocumentGridContextMenu.cs (2)
231private void SetMenuProperties(MenuItem menuItem, DocumentGrid dg, RoutedUICommand command) 236private void SetMenuProperties(MenuItem menuItem, DocumentGrid dg, RoutedUICommand command, string header, string inputGestureText)
src\Framework\System\Windows\Automation\Peers\MenuItemAutomationPeer.cs (25)
23public MenuItemAutomationPeer(MenuItem owner): base(owner) 43MenuItem owner = (MenuItem)Owner; 96MenuItem owner = (MenuItem)Owner; 120MenuItem owner = (MenuItem)Owner; 134MenuItem menuItem = (MenuItem)Owner; 185MenuItem owner = (MenuItem)Owner; 203MenuItem owner = (MenuItem)Owner; 212owner.SetCurrentValueInternal(MenuItem.IsSubmenuOpenProperty, MS.Internal.KnownBoxes.BooleanBoxes.FalseBox); 221MenuItem owner = (MenuItem)Owner; 243MenuItem owner = (MenuItem)Owner; 263MenuItem owner = (MenuItem)Owner; 270owner.SetCurrentValueInternal(MenuItem.IsCheckedProperty, MS.Internal.KnownBoxes.BooleanBoxes.Box(!owner.IsChecked)); 278MenuItem owner = (MenuItem)Owner; 301MenuItem menuItem = (MenuItem)Owner;
src\Framework\System\Windows\Controls\ContextMenu.cs (3)
404MenuItem.PrepareMenuItem(element, item); 473MenuItem.InsideContextMenuProperty.AddOwner(typeof(ContextMenu), 486MenuItem.SetInsideContextMenuProperty(this, true);
src\Framework\System\Windows\Controls\Menu.cs (5)
198MenuItem.PrepareMenuItem(element, item); 328MenuItem newSelection = info.Container as MenuItem; 380MenuItem menuItem = ItemContainerGenerator.ContainerFromIndex(i) as MenuItem;
src\Framework\System\Windows\Controls\MenuItem.cs (117)
73[StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(MenuItem))] 94_topLevelItemTemplateKey = new ComponentResourceKey(typeof(MenuItem), "TopLevelItemTemplateKey"); 110_topLevelHeaderTemplateKey = new ComponentResourceKey(typeof(MenuItem), "TopLevelHeaderTemplateKey"); 126_submenuItemTemplateKey = new ComponentResourceKey(typeof(MenuItem), "SubmenuItemTemplateKey"); 142_submenuHeaderTemplateKey = new ComponentResourceKey(typeof(MenuItem), "SubmenuHeaderTemplateKey"); 173HeaderProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(null, new CoerceValueCallback(CoerceHeader))); 175EventManager.RegisterClassHandler(typeof(MenuItem), AccessKeyManager.AccessKeyPressedEvent, new AccessKeyPressedEventHandler(OnAccessKeyPressed)); 176EventManager.RegisterClassHandler(typeof(MenuItem), MenuBase.IsSelectedChangedEvent, new RoutedPropertyChangedEventHandler<bool>(OnIsSelectedChanged)); 178ForegroundProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(SystemColors.MenuTextBrush)); 179FontFamilyProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(SystemFonts.MessageFontFamily)); 180FontSizeProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(SystemFonts.MessageFontSize)); 181FontStyleProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(SystemFonts.MessageFontStyle)); 182FontWeightProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(SystemFonts.MessageFontWeight)); 185ToolTipService.IsEnabledProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(null, new CoerceValueCallback(CoerceToolTipIsEnabled))); 191DefaultStyleKeyProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(typeof(MenuItem))); 192_dType = DependencyObjectType.FromSystemTypeInternal(typeof(MenuItem)); 194KeyboardNavigation.DirectionalNavigationProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(KeyboardNavigationMode.None)); 197FocusVisualStyleProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata((object)null /* default value */)); 203InputMethod.IsInputMethodSuspendedProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(BooleanBoxes.TrueBox, FrameworkPropertyMetadataOptions.Inherits)); 204AutomationProperties.IsOffscreenBehaviorProperty.OverrideMetadata(typeof(MenuItem), new FrameworkPropertyMetadata(IsOffscreenBehavior.FromClip)); 220public static readonly RoutedEvent ClickEvent = EventManager.RegisterRoutedEvent("Click", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 230AddHandler(MenuItem.ClickEvent, value); 235RemoveHandler(MenuItem.ClickEvent, value); 243internal static readonly RoutedEvent PreviewClickEvent = EventManager.RegisterRoutedEvent("PreviewClick", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 248public static readonly RoutedEvent CheckedEvent = EventManager.RegisterRoutedEvent("Checked", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 253public static readonly RoutedEvent UncheckedEvent = EventManager.RegisterRoutedEvent("Unchecked", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 294EventManager.RegisterRoutedEvent("SubmenuOpened", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 300EventManager.RegisterRoutedEvent("SubmenuClosed", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuItem)); 347MenuItem menuItem = (MenuItem)d; 391typeof(MenuItem), 409MenuItem item = (MenuItem) d; 447MenuItem.SetBoolField(this, BoolField.CanExecuteInvalid, false); 451MenuItem parent = ItemsControl.ItemsControlFromItemContainer(this) as MenuItem; 459MenuItem.SetBoolField(this, BoolField.CanExecuteInvalid, true); 491typeof(MenuItem), 512typeof(MenuItem), 534typeof(MenuItem), 555MenuItem mi = (MenuItem) d; 569MenuItem mi = (MenuItem) d; 594MenuItem menuItem = (MenuItem)d; 630MenuItem subItem = menuItem.ItemContainerGenerator.ContainerFromIndex(i) as MenuItem; 631if (subItem != null && MenuItem.GetBoolField(subItem, BoolField.CanExecuteInvalid)) 640MenuItem.SetBoolField(menuItem, BoolField.IgnoreMouseEvents, true); 641MenuItem.SetBoolField(menuItem, BoolField.MouseEnterOnMouseMove, false); 649MenuItem.SetBoolField(menuItem, BoolField.IgnoreMouseEvents, false); 704MenuItem.SetBoolField(menuItem, BoolField.IgnoreNextMouseLeave, true); 750typeof(MenuItem), 809typeof(MenuItem), 826((MenuItem) target).UpdateRole(); 838typeof(MenuItem), 881typeof(MenuItem), 911typeof(MenuItem), 950MenuItem menuItem = (MenuItem) d; 971typeof(MenuItem), 1000typeof(MenuItem), 1008MenuItem menuItem = (MenuItem)d; 1043MenuItem menuItem = (MenuItem)sender; 1044MenuItem source = e.OriginalSource as MenuItem; 1096typeof(MenuItem), 1121MenuItem menuItem = (MenuItem)d; 1153typeof(MenuItem), 1168= DependencyProperty.RegisterReadOnly("IsSuspendingPopupAnimation", typeof(bool), typeof(MenuItem), 1199bool openedWithKeyboard = MenuItem.GetBoolField(this, BoolField.OpenedWithKeyboard); 1203MenuItem ignore = openedWithKeyboard ? null : this; 1215((MenuItem)arg).IsSuspendingPopupAnimation = true; 1222MenuItem.SetBoolField(this, BoolField.OpenedWithKeyboard, false); 1238typeof(MenuItem), 1254MenuBase.UsesItemContainerTemplateProperty.AddOwner(typeof(MenuItem)); 1303MenuItem.PrepareMenuItem(element, item); 1311MenuItem menuItem = element as MenuItem; 1323if (MenuItem.GetBoolField(menuItem, BoolField.CanExecuteInvalid)) 1390RaiseEvent(new RoutedEventArgs(MenuItem.PreviewClickEvent, this)); 1417RaiseEvent(new RoutedEventArgs(MenuItem.ClickEvent, this)); 1588MenuItem menuItem = sender as MenuItem; 1620if (e.Target != menuItem && e.Target is MenuItem) 1702MenuItem parent = ItemsControl.ItemsControlFromItemContainer(this) as MenuItem; 1704MenuItem.GetBoolField(parent, BoolField.MouseEnterOnMouseMove)) 1706MenuItem.SetBoolField(parent, BoolField.MouseEnterOnMouseMove, false); 1726if (parent == null || !MenuItem.GetBoolField(parent, BoolField.IgnoreMouseEvents)) 1751else if (parent is MenuItem) 1753MenuItem.SetBoolField(parent, BoolField.MouseEnterOnMouseMove, true); 1779MenuItem sibling = CurrentSibling; 1829if (MenuItem.GetBoolField(this, BoolField.IgnoreNextMouseLeave)) 1833MenuItem.SetBoolField(this, BoolField.IgnoreNextMouseLeave, false); 2046if ((parent != null) && (!MenuItem.GetBoolField(parent, BoolField.IgnoreMouseEvents))) 2049MenuItem.SetBoolField(parent, BoolField.IgnoreMouseEvents, true); 2055MenuItem.SetBoolField(parent, BoolField.IgnoreMouseEvents, false); 2125bool ret = (item is MenuItem) || (item is Separator); 2161if (itemContainer is MenuItem || itemContainer is Separator) 2167throw new InvalidOperationException(SR.Get(SRID.InvalidItemContainer, this.GetType().Name, typeof(MenuItem).Name, typeof(Separator).Name, itemContainer)); 2299= DependencyProperty.RegisterAttached("InsideContextMenu", typeof(bool), typeof(MenuItem), 2382if ((owner != null) && ((owner is MenuItem) || (owner is MenuBase))) 2399MenuItem.SetBoolField(this, BoolField.OpenedWithKeyboard, true); 2471private MenuItem CurrentSibling 2476MenuItem menuItemParent = parent as MenuItem; 2477MenuItem sibling = null; 2657string inputGestureText = ((MenuItem)d).InputGestureText; 2681private MenuItem CurrentSelection 2718typeof(MenuItem), 2774private MenuItem _currentSelection;
src\Framework\System\Windows\Controls\Primitives\MenuBase.cs (19)
31[StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(MenuItem))] 56EventManager.RegisterClassHandler(typeof(MenuBase), MenuItem.PreviewClickEvent, new RoutedEventHandler(OnMenuItemPreviewClick)); 341MenuItem newSelectedMenuItem = e.OriginalSource as MenuItem; 359menu.CurrentSelection.SetCurrentValueInternal(MenuItem.IsSubmenuOpenProperty, BooleanBoxes.FalseBox); 372menu.CurrentSelection.SetCurrentValueInternal(MenuItem.IsSubmenuOpenProperty, BooleanBoxes.Box(wasSubmenuOpen)); 459CurrentSelection.SetCurrentValueInternal(MenuItem.IsSubmenuOpenProperty, BooleanBoxes.FalseBox); 492bool ret = (item is MenuItem) || (item is Separator); 512if (itemContainer is MenuItem || itemContainer is Separator) 518throw new InvalidOperationException(SR.Get(SRID.InvalidItemContainer, this.GetType().Name, typeof(MenuItem).Name, typeof(Separator).Name, itemContainer)); 588MenuItem menuItemSource = e.OriginalSource as MenuItem; 699internal static void SetSuspendingPopupAnimation(ItemsControl menu, MenuItem ignore, bool suspend) 708MenuItem mi = menu.ItemContainerGenerator.ContainerFromIndex(i) as MenuItem; 761internal MenuItem CurrentSelection 775_currentSelection.SetCurrentValueInternal(MenuItem.IsSelectedProperty, BooleanBoxes.FalseBox); 781_currentSelection.SetCurrentValueInternal(MenuItem.IsSelectedProperty, BooleanBoxes.TrueBox); 970private MenuItem _currentSelection;
src\Framework\System\Windows\Controls\Primitives\Popup.cs (1)
2687|| (this.TemplatedParent is MenuItem))
src\Framework\System\Windows\Controls\Primitives\ScrollBar.cs (3)
903private static MenuItem CreateMenuItem(string name, string automationId, RoutedCommand command) 905MenuItem menuItem = new MenuItem(); 914menuItem.SetBinding(MenuItem.CommandTargetProperty, binding);
src\Framework\System\Windows\Controls\StickyNote.cs (23)
85[TemplatePart(Name = SNBConstants.c_CopyMenuId, Type = typeof(MenuItem))] 86[TemplatePart(Name = SNBConstants.c_PasteMenuId, Type = typeof(MenuItem))] 87[TemplatePart(Name = SNBConstants.c_InkMenuId, Type = typeof(MenuItem))] 88[TemplatePart(Name = SNBConstants.c_SelectMenuId, Type = typeof(MenuItem))] 89[TemplatePart(Name = SNBConstants.c_EraseMenuId, Type = typeof(MenuItem))] 1658MenuItem inkMenuItem = GetInkMenuItem(); 1667inkMenuItem.SetBinding(MenuItem.IsCheckedProperty, checkedBind); 1670MenuItem selectMenuItem = GetSelectMenuItem(); 1679selectMenuItem.SetBinding(MenuItem.IsCheckedProperty, checkedBind); 1682MenuItem eraseMenuItem = GetEraseMenuItem(); 1691eraseMenuItem.SetBinding(MenuItem.IsCheckedProperty, checkedBind); 1699MenuItem copyMenuItem = GetCopyMenuItem(); 1712MenuItem pasteMenuItem = GetPasteMenuItem(); 1851private MenuItem GetInkMenuItem() 1853return GetTemplateChild(SNBConstants.c_InkMenuId) as MenuItem; 1859private MenuItem GetSelectMenuItem() 1861return GetTemplateChild(SNBConstants.c_SelectMenuId) as MenuItem; 1867private MenuItem GetEraseMenuItem() 1869return GetTemplateChild(SNBConstants.c_EraseMenuId) as MenuItem; 1875private MenuItem GetCopyMenuItem() 1877return GetTemplateChild(SNBConstants.c_CopyMenuId) as MenuItem; 1883private MenuItem GetPasteMenuItem() 1885return GetTemplateChild(SNBConstants.c_PasteMenuId) as MenuItem;
src\Framework\System\windows\Documents\TextEditorContextMenu.cs (3)
507MenuItem menuItem; 577MenuItem menuItem; 644MenuItem menuItem;
src\Framework\System\Windows\Markup\Baml2006\Baml2006KnownTypes.cs (1)
495case 403: t = () => typeof(MenuItem); break;
src\Framework\System\Windows\Markup\Baml2006\WpfGeneratedKnownProperties.cs (9)
5150Type type = typeof(System.Windows.Controls.MenuItem); 5152this.GetXamlType(typeof(System.Windows.Controls.MenuItem)), // DeclaringType 5158bamlMember.GetDelegate = delegate(object target) { return ((System.Windows.Controls.MenuItem)target).Items; }; 7410Type type = typeof(System.Windows.Controls.MenuItem); 7411DependencyProperty dp = System.Windows.Controls.MenuItem.RoleProperty; 7413this.GetXamlType(typeof(System.Windows.Controls.MenuItem)), // DeclaringType 8071Type type = typeof(System.Windows.Controls.MenuItem); 8072DependencyProperty dp = System.Windows.Controls.MenuItem.IsCheckedProperty; 8074this.GetXamlType(typeof(System.Windows.Controls.MenuItem)), // DeclaringType
src\Framework\System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
6827typeof(System.Windows.Controls.MenuItem),
src\Framework\System\Windows\Markup\KnownTypes.cs (1)
5947case KnownElements.MenuItem: t = typeof(System.Windows.Controls.MenuItem); break;
src\Framework\System\Windows\SystemKeyConverter.cs (1)
194return typeof(MenuItem);
src\Framework\System\Windows\SystemResourceKey.cs (1)
1731return MenuItem.SeparatorStyleKey;
System.Activities.Core.Presentation (9)
System\Activities\Core\Presentation\FlowchartDesigner.xaml.cs (7)
94MenuItem setAsStartNode; 182MenuItem item = sender as MenuItem; 200MenuItem item = sender as MenuItem; 242MenuItem setAsStartNodeMenuItem = sender as MenuItem;
System\Activities\Core\Presentation\StateDesigner.xaml.cs (2)
156MenuItem item = sender as MenuItem;
System.Activities.Presentation (49)
System.Activities.Presentation\System\Activities\Presentation\View\ActivityTypeDesigner.xaml.cs (2)
39var toHide = menu.Items.OfType<MenuItem>().Where(p => 43foreach (var item in toHide)
System.Activities.Presentation\System\Activities\Presentation\View\DesignerView.Commands.cs (40)
324foreach (MenuItem menuItem in this.ContextMenu.Items.OfType<MenuItem>()) 358void RefreshContextMenu(MenuItem menuItem) 369foreach (MenuItem subItem in menuItem.Items.OfType<MenuItem>()) 527foreach (var item in menuSource.ContextMenu.Items.OfType<MenuItem>()) 535foreach (var item in menuSource.ContextMenu.Items.OfType<MenuItem>()) 570if (contextMenuItem is MenuItem) 572visible = ((MenuItem)contextMenuItem).Visibility == Visibility.Visible; 587.OfType<MenuItem>() 600MenuItem item = sender as MenuItem; 688MenuItem item = sender as MenuItem; 723MenuItem item = sender as MenuItem; 819MenuItem item = sender as MenuItem; 843MenuItem item = sender as MenuItem; 861MenuItem item = sender as MenuItem; 888MenuItem item = sender as MenuItem; 915MenuItem item = sender as MenuItem; 944MenuItem item = sender as MenuItem; 1024MenuItem item = sender as MenuItem; 1066MenuItem item = sender as MenuItem; 1281MenuItem item = sender as MenuItem; 1540MenuItem item = sender as MenuItem; 1748if (item is MenuItem && null != this.owner.MenuItemStyle) 1750((MenuItem)item).ItemContainerStyleSelector = this;
System.Activities.Presentation\System\Activities\Presentation\View\DesignerView.xaml.cs (2)
1769var menuItem = values[0] as MenuItem;
System.Activities.Presentation\System\Activities\Presentation\View\ExtensionWindow.cs (5)
61typeof(ObservableCollection<MenuItem>), 108this.MenuItems = new ObservableCollection<MenuItem>(); 189public ObservableCollection<MenuItem> MenuItems 191get { return (ObservableCollection<MenuItem>)GetValue(MenuItemsProperty); } 533foreach (MenuItem item in e.NewItems)