3 types derived from MenuItem
PresentationFramework (2)
MS\Internal\Documents\DocumentGridContextMenu.cs (1)
223
private class EditorMenuItem :
MenuItem
System\windows\Documents\TextEditorContextMenu.cs (1)
675
private class EditorMenuItem :
MenuItem
System.Windows.Controls.Ribbon (1)
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (1)
40
public class RibbonMenuItem :
MenuItem
, ISyncKeyTipAndContent
14 instantiations of MenuItem
PresentationFramework (11)
MS\Internal\Documents\DocumentGridContextMenu.cs (6)
149
SetMenuProperties(new
MenuItem
(), dg, ApplicationCommands.SelectAll);
154
new
MenuItem
(),
161
new
MenuItem
(),
168
new
MenuItem
(),
175
new
MenuItem
(),
183
SetMenuProperties(new
MenuItem
(), dg, ApplicationCommands.Print);
System\Windows\Controls\MenuItem.cs (1)
2106
return new
MenuItem
();
System\Windows\Controls\Primitives\MenuBase.cs (1)
509
return new
MenuItem
();
System\Windows\Controls\Primitives\ScrollBar.cs (1)
885
MenuItem menuItem = new
MenuItem
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
7501
DefaultConstructor = delegate () { return new System.Windows.Controls.
MenuItem
(); },
System\Windows\Markup\KnownTypes.cs (1)
1402
case KnownElements.MenuItem: o = new System.Windows.Controls.
MenuItem
(); break;
PresentationUI (3)
MS\Internal\Documents\DocumentApplicationDocumentViewer.cs (3)
1084
MenuItem menuItem = new
MenuItem
1091
menuItem = new
MenuItem
1098
menuItem = new
MenuItem
243 references to MenuItem
PresentationFramework (217)
MS\Internal\Documents\DocumentGridContextMenu.cs (2)
192
private void SetMenuProperties(
MenuItem
menuItem, DocumentGrid dg, RoutedUICommand command)
197
private void SetMenuProperties(
MenuItem
menuItem, DocumentGrid dg, RoutedUICommand command, string header, string inputGestureText)
System\Windows\Automation\Peers\MenuItemAutomationPeer.cs (25)
13
public MenuItemAutomationPeer(
MenuItem
owner): base(owner)
33
MenuItem
owner = (
MenuItem
)Owner;
86
MenuItem
owner = (
MenuItem
)Owner;
118
MenuItem
owner = (
MenuItem
)Owner;
145
MenuItem
menuItem = (
MenuItem
)Owner;
196
MenuItem
owner = (
MenuItem
)Owner;
214
MenuItem
owner = (
MenuItem
)Owner;
223
owner.SetCurrentValueInternal(
MenuItem
.IsSubmenuOpenProperty, MS.Internal.KnownBoxes.BooleanBoxes.FalseBox);
232
MenuItem
owner = (
MenuItem
)Owner;
254
MenuItem
owner = (
MenuItem
)Owner;
274
MenuItem
owner = (
MenuItem
)Owner;
281
owner.SetCurrentValueInternal(
MenuItem
.IsCheckedProperty, MS.Internal.KnownBoxes.BooleanBoxes.Box(!owner.IsChecked));
289
MenuItem
owner = (
MenuItem
)Owner;
322
MenuItem
menuItem = (
MenuItem
)Owner;
System\Windows\Controls\ContextMenu.cs (3)
391
MenuItem
.PrepareMenuItem(element, item);
460
MenuItem
.InsideContextMenuProperty.AddOwner(typeof(ContextMenu),
473
MenuItem
.SetInsideContextMenuProperty(this, true);
System\Windows\Controls\Menu.cs (5)
171
MenuItem
.PrepareMenuItem(element, item);
296
MenuItem
newSelection = info.Container as
MenuItem
;
343
MenuItem
menuItem = ItemContainerGenerator.ContainerFromIndex(i) as
MenuItem
;
System\Windows\Controls\MenuItem.cs (119)
60
[StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(
MenuItem
))]
80
_topLevelItemTemplateKey = new ComponentResourceKey(typeof(
MenuItem
), "TopLevelItemTemplateKey");
96
_topLevelHeaderTemplateKey = new ComponentResourceKey(typeof(
MenuItem
), "TopLevelHeaderTemplateKey");
112
_submenuItemTemplateKey = new ComponentResourceKey(typeof(
MenuItem
), "SubmenuItemTemplateKey");
128
_submenuHeaderTemplateKey = new ComponentResourceKey(typeof(
MenuItem
), "SubmenuHeaderTemplateKey");
159
HeaderProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(null, new CoerceValueCallback(CoerceHeader)));
161
EventManager.RegisterClassHandler(typeof(
MenuItem
), AccessKeyManager.AccessKeyPressedEvent, new AccessKeyPressedEventHandler(OnAccessKeyPressed));
162
EventManager.RegisterClassHandler(typeof(
MenuItem
), MenuBase.IsSelectedChangedEvent, new RoutedPropertyChangedEventHandler<bool>(OnIsSelectedChanged));
164
ForegroundProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(SystemColors.MenuTextBrush));
165
FontFamilyProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(SystemFonts.MessageFontFamily));
166
FontSizeProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(SystemFonts.ThemeMessageFontSize));
167
FontStyleProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(SystemFonts.MessageFontStyle));
168
FontWeightProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(SystemFonts.MessageFontWeight));
171
ToolTipService.IsEnabledProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(null, new CoerceValueCallback(CoerceToolTipIsEnabled)));
177
DefaultStyleKeyProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(typeof(
MenuItem
)));
178
_dType = DependencyObjectType.FromSystemTypeInternal(typeof(
MenuItem
));
180
KeyboardNavigation.DirectionalNavigationProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(KeyboardNavigationMode.None));
183
FocusVisualStyleProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata((object)null /* default value */));
189
InputMethod.IsInputMethodSuspendedProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(BooleanBoxes.TrueBox, FrameworkPropertyMetadataOptions.Inherits));
190
AutomationProperties.IsOffscreenBehaviorProperty.OverrideMetadata(typeof(
MenuItem
), new FrameworkPropertyMetadata(IsOffscreenBehavior.FromClip));
206
public static readonly RoutedEvent ClickEvent = EventManager.RegisterRoutedEvent("Click", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(
MenuItem
));
216
AddHandler(
MenuItem
.ClickEvent, value);
221
RemoveHandler(
MenuItem
.ClickEvent, value);
229
internal static readonly RoutedEvent PreviewClickEvent = EventManager.RegisterRoutedEvent("PreviewClick", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(
MenuItem
));
234
public static readonly RoutedEvent CheckedEvent = EventManager.RegisterRoutedEvent("Checked", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(
MenuItem
));
239
public static readonly RoutedEvent UncheckedEvent = EventManager.RegisterRoutedEvent("Unchecked", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(
MenuItem
));
280
EventManager.RegisterRoutedEvent("SubmenuOpened", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(
MenuItem
));
286
EventManager.RegisterRoutedEvent("SubmenuClosed", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(
MenuItem
));
333
MenuItem
menuItem = (
MenuItem
)d;
377
typeof(
MenuItem
),
395
MenuItem
item = (
MenuItem
) d;
433
MenuItem
.SetBoolField(this, BoolField.CanExecuteInvalid, false);
437
MenuItem
parent = ItemsControl.ItemsControlFromItemContainer(this) as
MenuItem
;
445
MenuItem
.SetBoolField(this, BoolField.CanExecuteInvalid, true);
477
typeof(
MenuItem
),
495
MenuItem
item = (
MenuItem
)d;
506
typeof(
MenuItem
),
528
typeof(
MenuItem
),
549
MenuItem
mi = (
MenuItem
) d;
563
MenuItem
mi = (
MenuItem
) d;
588
MenuItem
menuItem = (
MenuItem
)d;
624
MenuItem
subItem = menuItem.ItemContainerGenerator.ContainerFromIndex(i) as
MenuItem
;
625
if (subItem != null &&
MenuItem
.GetBoolField(subItem, BoolField.CanExecuteInvalid))
634
MenuItem
.SetBoolField(menuItem, BoolField.IgnoreMouseEvents, true);
635
MenuItem
.SetBoolField(menuItem, BoolField.MouseEnterOnMouseMove, false);
643
MenuItem
.SetBoolField(menuItem, BoolField.IgnoreMouseEvents, false);
698
MenuItem
.SetBoolField(menuItem, BoolField.IgnoreNextMouseLeave, true);
744
typeof(
MenuItem
),
803
typeof(
MenuItem
),
820
((
MenuItem
) target).UpdateRole();
832
typeof(
MenuItem
),
875
typeof(
MenuItem
),
905
typeof(
MenuItem
),
944
MenuItem
menuItem = (
MenuItem
) d;
971
typeof(
MenuItem
),
1000
typeof(
MenuItem
),
1008
MenuItem
menuItem = (
MenuItem
)d;
1043
MenuItem
menuItem = (
MenuItem
)sender;
1044
MenuItem
source = e.OriginalSource as
MenuItem
;
1096
typeof(
MenuItem
),
1121
MenuItem
menuItem = (
MenuItem
)d;
1153
typeof(
MenuItem
),
1168
= DependencyProperty.RegisterReadOnly("IsSuspendingPopupAnimation", typeof(bool), typeof(
MenuItem
),
1199
bool openedWithKeyboard =
MenuItem
.GetBoolField(this, BoolField.OpenedWithKeyboard);
1203
MenuItem
ignore = openedWithKeyboard ? null : this;
1215
((
MenuItem
)arg).IsSuspendingPopupAnimation = true;
1222
MenuItem
.SetBoolField(this, BoolField.OpenedWithKeyboard, false);
1238
typeof(
MenuItem
),
1254
MenuBase.UsesItemContainerTemplateProperty.AddOwner(typeof(
MenuItem
));
1303
MenuItem
.PrepareMenuItem(element, item);
1311
MenuItem
menuItem = element as
MenuItem
;
1323
if (
MenuItem
.GetBoolField(menuItem, BoolField.CanExecuteInvalid))
1373
RaiseEvent(new RoutedEventArgs(
MenuItem
.PreviewClickEvent, this));
1394
RaiseEvent(new RoutedEventArgs(
MenuItem
.ClickEvent, this));
1537
MenuItem
menuItem = sender as
MenuItem
;
1569
if (e.Target != menuItem && e.Target is
MenuItem
)
1651
MenuItem
parent = ItemsControl.ItemsControlFromItemContainer(this) as
MenuItem
;
1653
MenuItem
.GetBoolField(parent, BoolField.MouseEnterOnMouseMove))
1655
MenuItem
.SetBoolField(parent, BoolField.MouseEnterOnMouseMove, false);
1675
if (parent == null || !
MenuItem
.GetBoolField(parent, BoolField.IgnoreMouseEvents))
1700
else if (parent is
MenuItem
)
1702
MenuItem
.SetBoolField(parent, BoolField.MouseEnterOnMouseMove, true);
1728
MenuItem
sibling = CurrentSibling;
1778
if (
MenuItem
.GetBoolField(this, BoolField.IgnoreNextMouseLeave))
1782
MenuItem
.SetBoolField(this, BoolField.IgnoreNextMouseLeave, false);
1986
if ((parent != null) && (!
MenuItem
.GetBoolField(parent, BoolField.IgnoreMouseEvents)))
1989
MenuItem
.SetBoolField(parent, BoolField.IgnoreMouseEvents, true);
1995
MenuItem
.SetBoolField(parent, BoolField.IgnoreMouseEvents, false);
2059
bool ret = (item is
MenuItem
) || (item is Separator);
2095
if (itemContainer is
MenuItem
|| itemContainer is Separator)
2101
throw new InvalidOperationException(SR.Format(SR.InvalidItemContainer, this.GetType().Name, nameof(
MenuItem
), nameof(Separator), itemContainer));
2226
= DependencyProperty.RegisterAttached("InsideContextMenu", typeof(bool), typeof(
MenuItem
),
2298
if ((owner != null) && ((owner is
MenuItem
) || (owner is MenuBase)))
2315
MenuItem
.SetBoolField(this, BoolField.OpenedWithKeyboard, true);
2387
private
MenuItem
CurrentSibling
2392
MenuItem
menuItemParent = parent as
MenuItem
;
2393
MenuItem
sibling = null;
2573
string inputGestureText = ((
MenuItem
)d).InputGestureText;
2597
private
MenuItem
CurrentSelection
2628
typeof(
MenuItem
),
2684
private
MenuItem
_currentSelection;
System\Windows\Controls\Primitives\MenuBase.cs (19)
19
[StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(
MenuItem
))]
44
EventManager.RegisterClassHandler(typeof(MenuBase),
MenuItem
.PreviewClickEvent, new RoutedEventHandler(OnMenuItemPreviewClick));
329
MenuItem
newSelectedMenuItem = e.OriginalSource as
MenuItem
;
347
menu.CurrentSelection.SetCurrentValueInternal(
MenuItem
.IsSubmenuOpenProperty, BooleanBoxes.FalseBox);
360
menu.CurrentSelection.SetCurrentValueInternal(
MenuItem
.IsSubmenuOpenProperty, BooleanBoxes.Box(wasSubmenuOpen));
445
CurrentSelection.SetCurrentValueInternal(
MenuItem
.IsSubmenuOpenProperty, BooleanBoxes.FalseBox);
478
bool ret = (item is
MenuItem
) || (item is Separator);
498
if (itemContainer is
MenuItem
|| itemContainer is Separator)
504
throw new InvalidOperationException(SR.Format(SR.InvalidItemContainer, this.GetType().Name, nameof(
MenuItem
), nameof(Separator), itemContainer));
574
MenuItem
menuItemSource = e.OriginalSource as
MenuItem
;
678
internal static void SetSuspendingPopupAnimation(ItemsControl menu,
MenuItem
ignore, bool suspend)
687
MenuItem
mi = menu.ItemContainerGenerator.ContainerFromIndex(i) as
MenuItem
;
740
internal
MenuItem
CurrentSelection
754
_currentSelection.SetCurrentValueInternal(
MenuItem
.IsSelectedProperty, BooleanBoxes.FalseBox);
760
_currentSelection.SetCurrentValueInternal(
MenuItem
.IsSelectedProperty, BooleanBoxes.TrueBox);
930
private
MenuItem
_currentSelection;
System\Windows\Controls\Primitives\Popup.cs (1)
2679
|| (this.TemplatedParent is
MenuItem
))
System\Windows\Controls\Primitives\ScrollBar.cs (3)
883
private static
MenuItem
CreateMenuItem(string name, string automationId, RoutedCommand command)
885
MenuItem
menuItem = new MenuItem
898
menuItem.SetBinding(
MenuItem
.CommandTargetProperty, binding);
System\Windows\Controls\StickyNote.cs (23)
47
[TemplatePart(Name = SNBConstants.c_CopyMenuId, Type = typeof(
MenuItem
))]
48
[TemplatePart(Name = SNBConstants.c_PasteMenuId, Type = typeof(
MenuItem
))]
49
[TemplatePart(Name = SNBConstants.c_InkMenuId, Type = typeof(
MenuItem
))]
50
[TemplatePart(Name = SNBConstants.c_SelectMenuId, Type = typeof(
MenuItem
))]
51
[TemplatePart(Name = SNBConstants.c_EraseMenuId, Type = typeof(
MenuItem
))]
1600
MenuItem
inkMenuItem = GetInkMenuItem();
1611
inkMenuItem.SetBinding(
MenuItem
.IsCheckedProperty, checkedBind);
1614
MenuItem
selectMenuItem = GetSelectMenuItem();
1625
selectMenuItem.SetBinding(
MenuItem
.IsCheckedProperty, checkedBind);
1628
MenuItem
eraseMenuItem = GetEraseMenuItem();
1639
eraseMenuItem.SetBinding(
MenuItem
.IsCheckedProperty, checkedBind);
1643
MenuItem
copyMenuItem = GetCopyMenuItem();
1646
MenuItem
pasteMenuItem = GetPasteMenuItem();
1766
private
MenuItem
GetInkMenuItem()
1768
return GetTemplateChild(SNBConstants.c_InkMenuId) as
MenuItem
;
1774
private
MenuItem
GetSelectMenuItem()
1776
return GetTemplateChild(SNBConstants.c_SelectMenuId) as
MenuItem
;
1782
private
MenuItem
GetEraseMenuItem()
1784
return GetTemplateChild(SNBConstants.c_EraseMenuId) as
MenuItem
;
1790
private
MenuItem
GetCopyMenuItem()
1792
return GetTemplateChild(SNBConstants.c_CopyMenuId) as
MenuItem
;
1798
private
MenuItem
GetPasteMenuItem()
1800
return GetTemplateChild(SNBConstants.c_PasteMenuId) as
MenuItem
;
System\windows\Documents\TextEditorContextMenu.cs (3)
478
MenuItem
menuItem;
548
MenuItem
menuItem;
611
MenuItem
menuItem;
System\Windows\Markup\Baml2006\Baml2006KnownTypes.cs (1)
496
case 403: t = () => typeof(
MenuItem
); break;
System\Windows\Markup\Baml2006\WpfGeneratedKnownProperties.cs (9)
5506
Type type = typeof(System.Windows.Controls.
MenuItem
);
5508
this.GetXamlType(typeof(System.Windows.Controls.
MenuItem
)), // DeclaringType
5515
GetDelegate = delegate (object target) { return ((System.Windows.Controls.
MenuItem
)target).Items; },
8039
Type type = typeof(System.Windows.Controls.
MenuItem
);
8040
DependencyProperty dp = System.Windows.Controls.
MenuItem
.RoleProperty;
8042
this.GetXamlType(typeof(System.Windows.Controls.
MenuItem
)), // DeclaringType
8776
Type type = typeof(System.Windows.Controls.
MenuItem
);
8777
DependencyProperty dp = System.Windows.Controls.
MenuItem
.IsCheckedProperty;
8779
this.GetXamlType(typeof(System.Windows.Controls.
MenuItem
)), // DeclaringType
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
7498
typeof(System.Windows.Controls.
MenuItem
),
System\Windows\Markup\KnownTypes.cs (1)
5950
case KnownElements.MenuItem: t = typeof(System.Windows.Controls.
MenuItem
); break;
System\Windows\SystemKeyConverter.cs (1)
182
return typeof(
MenuItem
);
System\Windows\SystemResourceKey.cs (1)
1822
return
MenuItem
.SeparatorStyleKey;
PresentationUI (18)
MS\Internal\Documents\DocumentApplicationDocumentViewer.cs (6)
917
private
MenuItem
DigitalSignaturesMenuItem
924
_digitalSignaturesMenuItem = GetTemplateChild(_digitalSignaturesMenuItemName) as
MenuItem
;
1084
MenuItem
menuItem = new MenuItem
1248
MenuItem
menuItem = sender as
MenuItem
;
2216
private
MenuItem
_digitalSignaturesMenuItem;
src\wpf\artifacts\obj\PresentationUI\x64\Release\net11.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));
System.Windows.Controls.Ribbon (8)
Microsoft\Windows\Controls\Ribbon\RibbonContextMenu.cs (2)
565
separator.SetResourceReference(StyleProperty,
MenuItem
.SeparatorStyleKey);
567
separator.DefaultStyleKeyInternal =
MenuItem
.SeparatorStyleKey;
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (1)
2256
markupProp.DependencyProperty ==
MenuItem
.IsSubmenuOpenProperty)
Microsoft\Windows\Controls\Ribbon\RibbonMenuButton.cs (2)
580
separator.SetResourceReference(StyleProperty,
MenuItem
.SeparatorStyleKey);
582
separator.DefaultStyleKeyInternal =
MenuItem
.SeparatorStyleKey;
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (2)
555
separator.SetResourceReference(StyleProperty,
MenuItem
.SeparatorStyleKey);
557
separator.DefaultStyleKeyInternal =
MenuItem
.SeparatorStyleKey;
Microsoft\Windows\Controls\Ribbon\RibbonSplitButton.cs (1)
232
public static readonly RoutedEvent ClickEvent =
MenuItem
.ClickEvent.AddOwner(typeof(RibbonSplitButton));