3 types derived from MenuItem
Microsoft.Maui.Controls (3)
Menu\MenuFlyoutItem.cs (1)
9
public partial class MenuFlyoutItem :
MenuItem
, IMenuFlyoutItem
SwipeView\SwipeItem.cs (1)
9
public partial class SwipeItem :
MenuItem
, Controls.ISwipeItem, Maui.ISwipeItemMenuItem
Toolbar\ToolbarItem.cs (1)
7
public class ToolbarItem :
MenuItem
68 references to MenuItem
Microsoft.Maui.Controls (68)
Cells\Cell.cs (6)
21
ObservableCollection<
MenuItem
> _contextActions;
22
List<
MenuItem
> _currentContextActions;
87
public IList<
MenuItem
> ContextActions
93
_contextActions = new ObservableCollection<
MenuItem
>();
260
foreach (
MenuItem
item in _currentContextActions)
266
_currentContextActions = new List<
MenuItem
>(_contextActions);
Compatibility\Handlers\ListView\iOS\ContextActionCell.cs (11)
24
readonly List<
MenuItem
> _menuItems = new List<
MenuItem
>();
159
foreach (
var
item in _menuItems)
284
foreach (
var
item in _menuItems)
325
var
item = _cell.ContextActions[i];
326
var weakItem = new WeakReference<
MenuItem
>(item);
333
if (weakItem.TryGetTarget(out
MenuItem
mi))
374
UIButton GetButton(
MenuItem
item)
508
MenuItem
destructive = null;
513
var
item = _cell.ContextActions[i];
591
var
item = _cell.ContextActions[(int)b.Tag];
Compatibility\iOS\Extensions\ToolbarItemExtensions.cs (6)
74
if (e.PropertyName ==
MenuItem
.IsEnabledProperty.PropertyName)
76
else if (e.PropertyName ==
MenuItem
.TextProperty.PropertyName)
81
else if (e.PropertyName ==
MenuItem
.IconImageSourceProperty.PropertyName)
176
if (e.PropertyName ==
MenuItem
.TextProperty.PropertyName)
178
else if (e.PropertyName ==
MenuItem
.IconImageSourceProperty.PropertyName)
180
else if (e.PropertyName ==
MenuItem
.IsEnabledProperty.PropertyName)
Menu\MenuItem.cs (11)
16
public static readonly BindableProperty AcceleratorProperty = BindableProperty.CreateAttached(nameof(Accelerator), typeof(Accelerator), typeof(
MenuItem
), null);
20
nameof(Command), typeof(ICommand), typeof(
MenuItem
), null,
26
nameof(CommandParameter), typeof(object), typeof(
MenuItem
), null,
30
public static readonly BindableProperty IsDestructiveProperty = BindableProperty.Create(nameof(IsDestructive), typeof(bool), typeof(
MenuItem
), false);
33
public static readonly BindableProperty IconImageSourceProperty = BindableProperty.Create(nameof(IconImageSource), typeof(ImageSource), typeof(
MenuItem
), default(ImageSource),
36
((
MenuItem
)bindable).AddRemoveLogicalChildren(oldValue, newValue);
42
nameof(IsEnabled), typeof(bool), typeof(
MenuItem
), true,
46
public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(
MenuItem
), null);
121
if (bindable is not
MenuItem
menuItem)
142
if (menuItem.Parent is
MenuItem
parentMenuItem && !parentMenuItem.IsEnabled)
179
if (bindable is not
MenuItem
|| bindable is not IPropertyPropagationController ppc)
Shell\BaseShellItem.cs (3)
443
if (bo is
MenuItem
)
445
imageBinding = Binding.Create(static (
MenuItem
item) => item.IconImageSource);
446
labelBinding = Binding.Create(static (
MenuItem
item) => item.Text);
Shell\MenuItemCollection.cs (13)
10
public sealed class MenuItemCollection : IEnumerable<
MenuItem
>, IList<
MenuItem
>, INotifyCollectionChanged
12
ObservableCollection<
MenuItem
> _inner = new ObservableCollection<
MenuItem
>();
24
public bool IsReadOnly => ((IList<
MenuItem
>)_inner).IsReadOnly;
26
public
MenuItem
this[int index]
33
public void Add(
MenuItem
item) => _inner.Add(item);
39
public bool Contains(
MenuItem
item) => _inner.Contains(item);
42
public void CopyTo(
MenuItem
[] array, int arrayIndex) => _inner.CopyTo(array, arrayIndex);
45
public IEnumerator<
MenuItem
> GetEnumerator() => _inner.GetEnumerator();
48
public int IndexOf(
MenuItem
item) => _inner.IndexOf(item);
51
public void Insert(int index,
MenuItem
item) => _inner.Insert(index, item);
54
public bool Remove(
MenuItem
item) => _inner.Remove(item);
Shell\MenuShellItem.cs (7)
12
internal MenuShellItem(
MenuItem
menuItem)
18
this.SetBinding(TitleProperty, static (
MenuItem
item) => item.Text, BindingMode.OneWay, source: menuItem);
19
this.SetBinding(IconProperty, static (
MenuItem
item) => item.IconImageSource, BindingMode.OneWay, source: menuItem);
20
this.SetBinding(FlyoutIconProperty, static (
MenuItem
item) => item.IconImageSource, BindingMode.OneWay, source: menuItem);
21
this.SetBinding(AutomationIdProperty, static (
MenuItem
item) => item.AutomationId, BindingMode.OneWay, source: menuItem);
35
OnPropertyChanged(
MenuItem
.TextProperty.PropertyName);
49
public
MenuItem
MenuItem { get; }
Shell\Shell.cs (7)
145
/// Customizes the appearance of each <see cref = "
MenuItem
" />.
151
/// Gets the <see cref = "DataTemplate" /> applied to <see cref = "
MenuItem
" /> objects in the MenuItems collection.
158
/// Sets the <see cref = "DataTemplate" /> applied to <see cref = "
MenuItem
" /> objects in the MenuItems collection.
164
/// <param name="obj">The object that sets the <see cref = "DataTemplate" /> applied to <see cref = "
MenuItem
" /> objects.</param>
165
/// <param name="menuItemTemplate">The <see cref = "DataTemplate" /> applied to <see cref = "
MenuItem
" /> objects.</param>
638
if (bo is
MenuItem
mi && mi.Parent != null && mi.Parent.IsSet(MenuItemTemplateProperty))
826
case
MenuItem
m:
Shell\ShellFlyoutItemsManager.cs (1)
218
foreach (
var
item in menuItems)
Shell\ShellItem.cs (3)
243
public static implicit operator ShellItem(
MenuItem
menuItem) => new MenuShellItem(menuItem);
353
|| sourceType == typeof(
MenuItem
);
364
MenuItem
menuItem => (ShellItem)menuItem,