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