3 types derived from MenuItem
PresentationFramework (2)
MS\Internal\Documents\DocumentGridContextMenu.cs (1)
222
private class EditorMenuItem :
MenuItem
System\windows\Documents\TextEditorContextMenu.cs (1)
660
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)
148
SetMenuProperties(new
MenuItem
(), dg, ApplicationCommands.SelectAll);
153
new
MenuItem
(),
160
new
MenuItem
(),
167
new
MenuItem
(),
174
new
MenuItem
(),
182
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)
884
MenuItem menuItem = new
MenuItem
();
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
6831
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)
1088
MenuItem menuItem = new
MenuItem
();
1093
menuItem = new
MenuItem
();
1098
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)
191
private void SetMenuProperties(
MenuItem
menuItem, DocumentGrid dg, RoutedUICommand command)
196
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));
2240
= DependencyProperty.RegisterAttached("InsideContextMenu", typeof(bool), typeof(
MenuItem
),
2312
if ((owner != null) && ((owner is
MenuItem
) || (owner is MenuBase)))
2329
MenuItem
.SetBoolField(this, BoolField.OpenedWithKeyboard, true);
2401
private
MenuItem
CurrentSibling
2406
MenuItem
menuItemParent = parent as
MenuItem
;
2407
MenuItem
sibling = null;
2590
string inputGestureText = ((
MenuItem
)d).InputGestureText;
2614
private
MenuItem
CurrentSelection
2651
typeof(
MenuItem
),
2707
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)
2672
|| (this.TemplatedParent is
MenuItem
))
System\Windows\Controls\Primitives\ScrollBar.cs (3)
882
private static
MenuItem
CreateMenuItem(string name, string automationId, RoutedCommand command)
884
MenuItem
menuItem = new MenuItem();
893
menuItem.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
))]
1632
MenuItem
inkMenuItem = GetInkMenuItem();
1641
inkMenuItem.SetBinding(
MenuItem
.IsCheckedProperty, checkedBind);
1644
MenuItem
selectMenuItem = GetSelectMenuItem();
1653
selectMenuItem.SetBinding(
MenuItem
.IsCheckedProperty, checkedBind);
1656
MenuItem
eraseMenuItem = GetEraseMenuItem();
1665
eraseMenuItem.SetBinding(
MenuItem
.IsCheckedProperty, checkedBind);
1669
MenuItem
copyMenuItem = GetCopyMenuItem();
1675
MenuItem
pasteMenuItem = GetPasteMenuItem();
1798
private
MenuItem
GetInkMenuItem()
1800
return GetTemplateChild(SNBConstants.c_InkMenuId) as
MenuItem
;
1806
private
MenuItem
GetSelectMenuItem()
1808
return GetTemplateChild(SNBConstants.c_SelectMenuId) as
MenuItem
;
1814
private
MenuItem
GetEraseMenuItem()
1816
return GetTemplateChild(SNBConstants.c_EraseMenuId) as
MenuItem
;
1822
private
MenuItem
GetCopyMenuItem()
1824
return GetTemplateChild(SNBConstants.c_CopyMenuId) as
MenuItem
;
1830
private
MenuItem
GetPasteMenuItem()
1832
return GetTemplateChild(SNBConstants.c_PasteMenuId) as
MenuItem
;
System\windows\Documents\TextEditorContextMenu.cs (3)
479
MenuItem
menuItem;
543
MenuItem
menuItem;
602
MenuItem
menuItem;
System\Windows\Markup\Baml2006\Baml2006KnownTypes.cs (1)
497
case 403: t = () => typeof(
MenuItem
); break;
System\Windows\Markup\Baml2006\WpfGeneratedKnownProperties.cs (9)
5173
Type type = typeof(System.Windows.Controls.
MenuItem
);
5175
this.GetXamlType(typeof(System.Windows.Controls.
MenuItem
)), // DeclaringType
5181
bamlMember.GetDelegate = delegate(object target) { return ((System.Windows.Controls.
MenuItem
)target).Items; };
7450
Type type = typeof(System.Windows.Controls.
MenuItem
);
7451
DependencyProperty dp = System.Windows.Controls.
MenuItem
.RoleProperty;
7453
this.GetXamlType(typeof(System.Windows.Controls.
MenuItem
)), // DeclaringType
8111
Type type = typeof(System.Windows.Controls.
MenuItem
);
8112
DependencyProperty dp = System.Windows.Controls.
MenuItem
.IsCheckedProperty;
8114
this.GetXamlType(typeof(System.Windows.Controls.
MenuItem
)), // DeclaringType
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
6829
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)
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)
917
private
MenuItem
DigitalSignaturesMenuItem
924
_digitalSignaturesMenuItem = GetTemplateChild(_digitalSignaturesMenuItemName) as
MenuItem
;
1088
MenuItem
menuItem = new MenuItem();
1242
MenuItem
menuItem = sender as
MenuItem
;
2221
private
MenuItem
_digitalSignaturesMenuItem;
System.Windows.Controls.Ribbon (8)
Microsoft\Windows\Controls\Ribbon\RibbonContextMenu.cs (2)
552
separator.SetResourceReference(StyleProperty,
MenuItem
.SeparatorStyleKey);
554
separator.DefaultStyleKeyInternal =
MenuItem
.SeparatorStyleKey;
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (1)
2277
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));