3 types derived from MenuItem
PresentationFramework (2)
MS\Internal\Documents\DocumentGridContextMenu.cs (1)
224
private class EditorMenuItem :
MenuItem
System\windows\Documents\TextEditorContextMenu.cs (1)
676
private class EditorMenuItem :
MenuItem
System.Windows.Controls.Ribbon (1)
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (1)
41
public class RibbonMenuItem :
MenuItem
, ISyncKeyTipAndContent
14 instantiations of MenuItem
PresentationFramework (11)
MS\Internal\Documents\DocumentGridContextMenu.cs (6)
150
SetMenuProperties(new
MenuItem
(), dg, ApplicationCommands.SelectAll);
155
new
MenuItem
(),
162
new
MenuItem
(),
169
new
MenuItem
(),
176
new
MenuItem
(),
184
SetMenuProperties(new
MenuItem
(), dg, ApplicationCommands.Print);
System\Windows\Controls\MenuItem.cs (1)
2114
return new
MenuItem
();
System\Windows\Controls\Primitives\MenuBase.cs (1)
510
return new
MenuItem
();
System\Windows\Controls\Primitives\ScrollBar.cs (1)
886
MenuItem menuItem = new
MenuItem
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
7502
DefaultConstructor = delegate () { return new System.Windows.Controls.
MenuItem
(); },
System\Windows\Markup\KnownTypes.cs (1)
1403
case KnownElements.MenuItem: o = new System.Windows.Controls.
MenuItem
(); break;
PresentationUI (3)
MS\Internal\Documents\DocumentApplicationDocumentViewer.cs (3)
1092
MenuItem menuItem = new
MenuItem
1099
menuItem = new
MenuItem
1106
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)
193
private void SetMenuProperties(
MenuItem
menuItem, DocumentGrid dg, RoutedUICommand command)
198
private void SetMenuProperties(
MenuItem
menuItem, DocumentGrid dg, RoutedUICommand command, string header, string inputGestureText)
System\Windows\Automation\Peers\MenuItemAutomationPeer.cs (25)
14
public MenuItemAutomationPeer(
MenuItem
owner): base(owner)
34
MenuItem
owner = (
MenuItem
)Owner;
87
MenuItem
owner = (
MenuItem
)Owner;
119
MenuItem
owner = (
MenuItem
)Owner;
146
MenuItem
menuItem = (
MenuItem
)Owner;
197
MenuItem
owner = (
MenuItem
)Owner;
215
MenuItem
owner = (
MenuItem
)Owner;
224
owner.SetCurrentValueInternal(
MenuItem
.IsSubmenuOpenProperty, MS.Internal.KnownBoxes.BooleanBoxes.FalseBox);
233
MenuItem
owner = (
MenuItem
)Owner;
255
MenuItem
owner = (
MenuItem
)Owner;
275
MenuItem
owner = (
MenuItem
)Owner;
282
owner.SetCurrentValueInternal(
MenuItem
.IsCheckedProperty, MS.Internal.KnownBoxes.BooleanBoxes.Box(!owner.IsChecked));
290
MenuItem
owner = (
MenuItem
)Owner;
323
MenuItem
menuItem = (
MenuItem
)Owner;
System\Windows\Controls\ContextMenu.cs (3)
392
MenuItem
.PrepareMenuItem(element, item);
461
MenuItem
.InsideContextMenuProperty.AddOwner(typeof(ContextMenu),
474
MenuItem
.SetInsideContextMenuProperty(this, true);
System\Windows\Controls\Menu.cs (5)
172
MenuItem
.PrepareMenuItem(element, item);
297
MenuItem
newSelection = info.Container as
MenuItem
;
344
MenuItem
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");
160
HeaderProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(null, new CoerceValueCallback(CoerceHeader)));
162
EventManager.RegisterClassHandler(typeof(
MenuItem
), AccessKeyManager.AccessKeyPressedEvent, new AccessKeyPressedEventHandler(OnAccessKeyPressed));
163
EventManager.RegisterClassHandler(typeof(
MenuItem
), MenuBase.IsSelectedChangedEvent, new RoutedPropertyChangedEventHandler<bool>(OnIsSelectedChanged));
165
ForegroundProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(SystemColors.MenuTextBrush));
166
FontFamilyProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(SystemFonts.MessageFontFamily));
167
FontSizeProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(SystemFonts.ThemeMessageFontSize));
168
FontStyleProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(SystemFonts.MessageFontStyle));
169
FontWeightProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(SystemFonts.MessageFontWeight));
172
ToolTipService.IsEnabledProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(null, new CoerceValueCallback(CoerceToolTipIsEnabled)));
178
DefaultStyleKeyProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(typeof(
MenuItem
)));
179
_dType = DependencyObjectType.FromSystemTypeInternal(typeof(
MenuItem
));
181
KeyboardNavigation.DirectionalNavigationProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(KeyboardNavigationMode.None));
184
FocusVisualStyleProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata((object)null /* default value */));
190
InputMethod.IsInputMethodSuspendedProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(BooleanBoxes.TrueBox, FrameworkPropertyMetadataOptions.Inherits));
191
AutomationProperties.IsOffscreenBehaviorProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(IsOffscreenBehavior.FromClip));
207
public static readonly RoutedEvent ClickEvent = EventManager.RegisterRoutedEvent("Click", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(
MenuItem
));
217
AddHandler(
MenuItem
.ClickEvent, value);
222
RemoveHandler(
MenuItem
.ClickEvent, value);
230
internal static readonly RoutedEvent PreviewClickEvent = EventManager.RegisterRoutedEvent("PreviewClick", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(
MenuItem
));
235
public static readonly RoutedEvent CheckedEvent = EventManager.RegisterRoutedEvent("Checked", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(
MenuItem
));
240
public static readonly RoutedEvent UncheckedEvent = EventManager.RegisterRoutedEvent("Unchecked", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(
MenuItem
));
281
EventManager.RegisterRoutedEvent("SubmenuOpened", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(
MenuItem
));
287
EventManager.RegisterRoutedEvent("SubmenuClosed", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(
MenuItem
));
334
MenuItem
menuItem = (
MenuItem
)d;
378
typeof(
MenuItem
),
396
MenuItem
item = (
MenuItem
) d;
434
MenuItem
.SetBoolField(this, BoolField.CanExecuteInvalid, false);
438
MenuItem
parent = ItemsControl.ItemsControlFromItemContainer(this) as
MenuItem
;
446
MenuItem
.SetBoolField(this, BoolField.CanExecuteInvalid, true);
478
typeof(
MenuItem
),
496
MenuItem
item = (
MenuItem
)d;
507
typeof(
MenuItem
),
529
typeof(
MenuItem
),
550
MenuItem
mi = (
MenuItem
) d;
564
MenuItem
mi = (
MenuItem
) d;
589
MenuItem
menuItem = (
MenuItem
)d;
625
MenuItem
subItem = menuItem.ItemContainerGenerator.ContainerFromIndex(i) as
MenuItem
;
626
if (subItem != null &&
MenuItem
.GetBoolField(subItem, BoolField.CanExecuteInvalid))
635
MenuItem
.SetBoolField(menuItem, BoolField.IgnoreMouseEvents, true);
636
MenuItem
.SetBoolField(menuItem, BoolField.MouseEnterOnMouseMove, false);
644
MenuItem
.SetBoolField(menuItem, BoolField.IgnoreMouseEvents, false);
699
MenuItem
.SetBoolField(menuItem, BoolField.IgnoreNextMouseLeave, true);
745
typeof(
MenuItem
),
804
typeof(
MenuItem
),
821
((
MenuItem
) target).UpdateRole();
833
typeof(
MenuItem
),
876
typeof(
MenuItem
),
906
typeof(
MenuItem
),
945
MenuItem
menuItem = (
MenuItem
) d;
975
typeof(
MenuItem
),
1004
typeof(
MenuItem
),
1012
MenuItem
menuItem = (
MenuItem
)d;
1047
MenuItem
menuItem = (
MenuItem
)sender;
1048
MenuItem
source = e.OriginalSource as
MenuItem
;
1100
typeof(
MenuItem
),
1125
MenuItem
menuItem = (
MenuItem
)d;
1157
typeof(
MenuItem
),
1172
= DependencyProperty.RegisterReadOnly("IsSuspendingPopupAnimation", typeof(bool), typeof(
MenuItem
),
1203
bool openedWithKeyboard =
MenuItem
.GetBoolField(this, BoolField.OpenedWithKeyboard);
1207
MenuItem
ignore = openedWithKeyboard ? null : this;
1219
((
MenuItem
)arg).IsSuspendingPopupAnimation = true;
1226
MenuItem
.SetBoolField(this, BoolField.OpenedWithKeyboard, false);
1242
typeof(
MenuItem
),
1258
MenuBase.UsesItemContainerTemplateProperty.AddOwner(typeof(
MenuItem
));
1307
MenuItem
.PrepareMenuItem(element, item);
1315
MenuItem
menuItem = element as
MenuItem
;
1327
if (
MenuItem
.GetBoolField(menuItem, BoolField.CanExecuteInvalid))
1377
RaiseEvent(new RoutedEventArgs(
MenuItem
.PreviewClickEvent, this));
1399
RaiseEvent(new RoutedEventArgs(
MenuItem
.ClickEvent, this));
1542
MenuItem
menuItem = sender as
MenuItem
;
1574
if (e.Target != menuItem && e.Target is
MenuItem
)
1656
MenuItem
parent = ItemsControl.ItemsControlFromItemContainer(this) as
MenuItem
;
1658
MenuItem
.GetBoolField(parent, BoolField.MouseEnterOnMouseMove))
1660
MenuItem
.SetBoolField(parent, BoolField.MouseEnterOnMouseMove, false);
1680
if (parent == null || !
MenuItem
.GetBoolField(parent, BoolField.IgnoreMouseEvents))
1705
else if (parent is
MenuItem
)
1707
MenuItem
.SetBoolField(parent, BoolField.MouseEnterOnMouseMove, true);
1733
MenuItem
sibling = CurrentSibling;
1783
if (
MenuItem
.GetBoolField(this, BoolField.IgnoreNextMouseLeave))
1787
MenuItem
.SetBoolField(this, BoolField.IgnoreNextMouseLeave, false);
1994
if ((parent != null) && (!
MenuItem
.GetBoolField(parent, BoolField.IgnoreMouseEvents)))
1997
MenuItem
.SetBoolField(parent, BoolField.IgnoreMouseEvents, true);
2003
MenuItem
.SetBoolField(parent, BoolField.IgnoreMouseEvents, false);
2067
bool ret = (item is
MenuItem
) || (item is Separator);
2103
if (itemContainer is
MenuItem
|| itemContainer is Separator)
2109
throw new InvalidOperationException(SR.Format(SR.InvalidItemContainer, this.GetType().Name, typeof(
MenuItem
).Name, typeof(Separator).Name, itemContainer));
2242
= DependencyProperty.RegisterAttached("InsideContextMenu", typeof(bool), typeof(
MenuItem
),
2314
if ((owner != null) && ((owner is
MenuItem
) || (owner is MenuBase)))
2331
MenuItem
.SetBoolField(this, BoolField.OpenedWithKeyboard, true);
2403
private
MenuItem
CurrentSibling
2408
MenuItem
menuItemParent = parent as
MenuItem
;
2409
MenuItem
sibling = null;
2592
string inputGestureText = ((
MenuItem
)d).InputGestureText;
2616
private
MenuItem
CurrentSelection
2653
typeof(
MenuItem
),
2709
private
MenuItem
_currentSelection;
System\Windows\Controls\Primitives\MenuBase.cs (19)
20
[StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(
MenuItem
))]
45
EventManager.RegisterClassHandler(typeof(MenuBase),
MenuItem
.PreviewClickEvent, new RoutedEventHandler(OnMenuItemPreviewClick));
330
MenuItem
newSelectedMenuItem = e.OriginalSource as
MenuItem
;
348
menu.CurrentSelection.SetCurrentValueInternal(
MenuItem
.IsSubmenuOpenProperty, BooleanBoxes.FalseBox);
361
menu.CurrentSelection.SetCurrentValueInternal(
MenuItem
.IsSubmenuOpenProperty, BooleanBoxes.Box(wasSubmenuOpen));
446
CurrentSelection.SetCurrentValueInternal(
MenuItem
.IsSubmenuOpenProperty, BooleanBoxes.FalseBox);
479
bool ret = (item is
MenuItem
) || (item is Separator);
499
if (itemContainer is
MenuItem
|| itemContainer is Separator)
505
throw new InvalidOperationException(SR.Format(SR.InvalidItemContainer, this.GetType().Name, typeof(
MenuItem
).Name, typeof(Separator).Name, itemContainer));
575
MenuItem
menuItemSource = e.OriginalSource as
MenuItem
;
679
internal static void SetSuspendingPopupAnimation(ItemsControl menu,
MenuItem
ignore, bool suspend)
688
MenuItem
mi = menu.ItemContainerGenerator.ContainerFromIndex(i) as
MenuItem
;
741
internal
MenuItem
CurrentSelection
755
_currentSelection.SetCurrentValueInternal(
MenuItem
.IsSelectedProperty, BooleanBoxes.FalseBox);
761
_currentSelection.SetCurrentValueInternal(
MenuItem
.IsSelectedProperty, BooleanBoxes.TrueBox);
931
private
MenuItem
_currentSelection;
System\Windows\Controls\Primitives\Popup.cs (1)
2689
|| (this.TemplatedParent is
MenuItem
))
System\Windows\Controls\Primitives\ScrollBar.cs (3)
884
private static
MenuItem
CreateMenuItem(string name, string automationId, RoutedCommand command)
886
MenuItem
menuItem = new MenuItem
899
menuItem.SetBinding(
MenuItem
.CommandTargetProperty, binding);
System\Windows\Controls\StickyNote.cs (23)
48
[TemplatePart(Name = SNBConstants.c_CopyMenuId, Type = typeof(
MenuItem
))]
49
[TemplatePart(Name = SNBConstants.c_PasteMenuId, Type = typeof(
MenuItem
))]
50
[TemplatePart(Name = SNBConstants.c_InkMenuId, Type = typeof(
MenuItem
))]
51
[TemplatePart(Name = SNBConstants.c_SelectMenuId, Type = typeof(
MenuItem
))]
52
[TemplatePart(Name = SNBConstants.c_EraseMenuId, Type = typeof(
MenuItem
))]
1627
MenuItem
inkMenuItem = GetInkMenuItem();
1638
inkMenuItem.SetBinding(
MenuItem
.IsCheckedProperty, checkedBind);
1641
MenuItem
selectMenuItem = GetSelectMenuItem();
1652
selectMenuItem.SetBinding(
MenuItem
.IsCheckedProperty, checkedBind);
1655
MenuItem
eraseMenuItem = GetEraseMenuItem();
1666
eraseMenuItem.SetBinding(
MenuItem
.IsCheckedProperty, checkedBind);
1670
MenuItem
copyMenuItem = GetCopyMenuItem();
1676
MenuItem
pasteMenuItem = GetPasteMenuItem();
1799
private
MenuItem
GetInkMenuItem()
1801
return GetTemplateChild(SNBConstants.c_InkMenuId) as
MenuItem
;
1807
private
MenuItem
GetSelectMenuItem()
1809
return GetTemplateChild(SNBConstants.c_SelectMenuId) as
MenuItem
;
1815
private
MenuItem
GetEraseMenuItem()
1817
return GetTemplateChild(SNBConstants.c_EraseMenuId) as
MenuItem
;
1823
private
MenuItem
GetCopyMenuItem()
1825
return GetTemplateChild(SNBConstants.c_CopyMenuId) as
MenuItem
;
1831
private
MenuItem
GetPasteMenuItem()
1833
return GetTemplateChild(SNBConstants.c_PasteMenuId) as
MenuItem
;
System\windows\Documents\TextEditorContextMenu.cs (3)
479
MenuItem
menuItem;
549
MenuItem
menuItem;
612
MenuItem
menuItem;
System\Windows\Markup\Baml2006\Baml2006KnownTypes.cs (1)
497
case 403: t = () => typeof(
MenuItem
); break;
System\Windows\Markup\Baml2006\WpfGeneratedKnownProperties.cs (9)
5507
Type type = typeof(System.Windows.Controls.
MenuItem
);
5509
this.GetXamlType(typeof(System.Windows.Controls.
MenuItem
)), // DeclaringType
5516
GetDelegate = delegate (object target) { return ((System.Windows.Controls.
MenuItem
)target).Items; },
8036
Type type = typeof(System.Windows.Controls.
MenuItem
);
8037
DependencyProperty dp = System.Windows.Controls.
MenuItem
.RoleProperty;
8039
this.GetXamlType(typeof(System.Windows.Controls.
MenuItem
)), // DeclaringType
8773
Type type = typeof(System.Windows.Controls.
MenuItem
);
8774
DependencyProperty dp = System.Windows.Controls.
MenuItem
.IsCheckedProperty;
8776
this.GetXamlType(typeof(System.Windows.Controls.
MenuItem
)), // DeclaringType
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
7499
typeof(System.Windows.Controls.
MenuItem
),
System\Windows\Markup\KnownTypes.cs (1)
5951
case KnownElements.MenuItem: t = typeof(System.Windows.Controls.
MenuItem
); break;
System\Windows\SystemKeyConverter.cs (1)
183
return typeof(
MenuItem
);
System\Windows\SystemResourceKey.cs (1)
1823
return
MenuItem
.SeparatorStyleKey;
PresentationUI (18)
artifacts\obj\PresentationUI\x86\Debug\net10.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)
921
private
MenuItem
DigitalSignaturesMenuItem
928
_digitalSignaturesMenuItem = GetTemplateChild(_digitalSignaturesMenuItemName) as
MenuItem
;
1092
MenuItem
menuItem = new MenuItem
1256
MenuItem
menuItem = sender as
MenuItem
;
2224
private
MenuItem
_digitalSignaturesMenuItem;
System.Windows.Controls.Ribbon (8)
Microsoft\Windows\Controls\Ribbon\RibbonContextMenu.cs (2)
566
separator.SetResourceReference(StyleProperty,
MenuItem
.SeparatorStyleKey);
568
separator.DefaultStyleKeyInternal =
MenuItem
.SeparatorStyleKey;
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (1)
2281
markupProp.DependencyProperty ==
MenuItem
.IsSubmenuOpenProperty)
Microsoft\Windows\Controls\Ribbon\RibbonMenuButton.cs (2)
581
separator.SetResourceReference(StyleProperty,
MenuItem
.SeparatorStyleKey);
583
separator.DefaultStyleKeyInternal =
MenuItem
.SeparatorStyleKey;
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (2)
556
separator.SetResourceReference(StyleProperty,
MenuItem
.SeparatorStyleKey);
558
separator.DefaultStyleKeyInternal =
MenuItem
.SeparatorStyleKey;
Microsoft\Windows\Controls\Ribbon\RibbonSplitButton.cs (1)
243
public static readonly RoutedEvent ClickEvent =
MenuItem
.ClickEvent.AddOwner(typeof(RibbonSplitButton));