OverflowMenuItemCollection Class
A collection that unions a primary menu item with above and below menu item collections.
public class OverflowMenuItemCollection : AvaloniaObject
- Inheritance:
- object AvaloniaObject object
Remarks
This collection can be usd as an items source in overflow menus.
Constructors
OverflowMenuItemCollection()
Initializes an instance of the class.
public OverflowMenuItemCollection()
Properties
AboveMenuItems
The collection of menu items that appear above the primary menu item.
BelowMenuItems
The collection of menu items that appear below the primary menu item.
Count
Gets the number of elements contained in the ICollection.
IsFixedSize
Gets a value indicating whether the IList has a fixed size.
public bool IsFixedSize { get; }
Property Value
IsReadOnly
Gets a value indicating whether the IList is read-only.
public bool IsReadOnly { get; }
Property Value
IsSynchronized
Gets a value indicating whether access to the ICollection is synchronized (thread safe).
public bool IsSynchronized { get; }
Property Value
- bool:
true
if access to the ICollection is synchronized (thread safe); otherwise,false
.
this[int]
Returns the item at the specified index.
public object? this[int index] { get; set; }
Parameter | Type | Description |
---|---|---|
index | int | The item index. |
Property Value
- object:
The item at the specified index.
PrimaryMenuItem
The primary menu item.
SyncRoot
Gets an object that can be used to synchronize access to the ICollection.
public object SyncRoot { get; }
Property Value
- object:
An object that can be used to synchronize access to the ICollection.
Methods
Add(object?)
Adds an item to the IList.
public int Add(object? value)
Parameter | Type | Description |
---|---|---|
value | object | The object to add to the IList. |
Returns
- int:
The position into which the new element was inserted, or -1 to indicate that the item was not inserted into the collection.
Exceptions
Type | Condition |
---|---|
NotSupportedException | The IList is read-only. -or- The IList has a fixed size. |
Clear()
Removes all items from the IList.
Contains(object?)
Determines whether the IList contains a specific value.
public bool Contains(object? value)
Parameter | Type | Description |
---|---|---|
value | object | The object to locate in the IList. |
Returns
CopyTo(Array, int)
Copies the elements of the ICollection to an Array, starting at a particular Array index.
public void CopyTo(Array array, int index)
Parameter | Type | Description |
---|---|---|
array | Array | The one-dimensional Array that is the destination of the elements copied from ICollection. The Array must have zero-based indexing. |
index | int | The zero-based index in |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentException |
-or- The number of elements in the source ICollection is greater than the available space from -or- The type of the source ICollection cannot be cast automatically to the type of the destination |
GetEnumerator()
Returns an enumerator that iterates through a collection.
public IEnumerator<object?> GetEnumerator()
Returns
- IEnumerator<object>:
An IEnumerator object that can be used to iterate through the collection.
IndexOf(object?)
Determines the index of a specific item in the IList.
public int IndexOf(object? value)
Parameter | Type | Description |
---|---|---|
value | object | The object to locate in the IList. |
Returns
- int:
The index of
value
if found in the list; otherwise, -1.
Insert(int, object?)
Inserts an item to the IList at the specified index.
public void Insert(int index, object? value)
Parameter | Type | Description |
---|---|---|
index | int | The zero-based index at which |
value | object | The object to insert into the IList. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
NotSupportedException | The IList is read-only. -or- The IList has a fixed size. |
NullReferenceException |
|
OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
Called when a avalonia property changes on the object.
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
Parameter | Type | Description |
---|---|---|
change | AvaloniaPropertyChangedEventArgs | The property change details. |
Remove(object?)
Removes the first occurrence of a specific object from the IList.
public void Remove(object? value)
Parameter | Type | Description |
---|---|---|
value | object | The object to remove from the IList. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | The IList is read-only. -or- The IList has a fixed size. |
RemoveAt(int)
Removes the IList item at the specified index.
public void RemoveAt(int index)
Parameter | Type | Description |
---|---|---|
index | int | The zero-based index of the item to remove. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
NotSupportedException | The IList is read-only. -or- The IList has a fixed size. |
Events
CollectionChanged
Occurs when the collection changes.
public event NotifyCollectionChangedEventHandler? CollectionChanged
Event Type
Fields
AboveMenuItemsProperty
Defines the AboveMenuItems property.
public static readonly DirectProperty<OverflowMenuItemCollection, IEnumerable<object>?> AboveMenuItemsProperty
BelowMenuItemsProperty
Defines the BelowMenuItems property.
public static readonly DirectProperty<OverflowMenuItemCollection, IEnumerable<object>?> BelowMenuItemsProperty
PrimaryMenuItemProperty
Defines the PrimaryMenuItem property.
public static readonly DirectProperty<OverflowMenuItemCollection, object?> PrimaryMenuItemProperty
Inherited Members
- AvaloniaObject.CheckAccess()
- AvaloniaObject.VerifyAccess()
- AvaloniaObject.ClearValue(AvaloniaProperty)
- AvaloniaObject.ClearValue<T>(AvaloniaProperty<T>)
- AvaloniaObject.ClearValue<T>(StyledProperty<T>)
- AvaloniaObject.ClearValue<T>(DirectPropertyBase<T>)
- AvaloniaObject.Equals(object)
- AvaloniaObject.GetHashCode()
- AvaloniaObject.GetValue(AvaloniaProperty)
- AvaloniaObject.GetValue<T>(StyledProperty<T>)
- AvaloniaObject.GetValue<T>(DirectPropertyBase<T>)
- AvaloniaObject.GetBaseValue<T>(StyledProperty<T>)
- AvaloniaObject.IsAnimating(AvaloniaProperty)
- AvaloniaObject.IsSet(AvaloniaProperty)
- AvaloniaObject.SetValue(AvaloniaProperty, object, BindingPriority)
- AvaloniaObject.SetValue<T>(StyledProperty<T>, T, BindingPriority)
- AvaloniaObject.SetValue<T>(DirectPropertyBase<T>, T)
- AvaloniaObject.SetCurrentValue(AvaloniaProperty, object)
- AvaloniaObject.SetCurrentValue<T>(StyledProperty<T>, T)
- AvaloniaObject.Bind(AvaloniaProperty, IBinding)
- AvaloniaObject.Bind(AvaloniaProperty, IObservable<object>, BindingPriority)
- AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<object>, BindingPriority)
- AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<T>, BindingPriority)
- AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<BindingValue<T>>, BindingPriority)
- AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<object>)
- AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<T>)
- AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<BindingValue<T>>)
- AvaloniaObject.CoerceValue(AvaloniaProperty)
- AvaloniaObject.UpdateDataValidation(AvaloniaProperty, BindingValueType, Exception)
- AvaloniaObject.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs)
- AvaloniaObject.RaisePropertyChanged<T>(DirectPropertyBase<T>, T, T)
- AvaloniaObject.SetAndRaise<T>(DirectPropertyBase<T>, ref T, T)
- AvaloniaObject.InheritanceParent
- AvaloniaObject.this[AvaloniaProperty]
- AvaloniaObject.this[IndexerDescriptor]
- AvaloniaObject.PropertyChanged
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object, object)
- object.ReferenceEquals(object, object)