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