Classes Class

Holds a collection of style classes for an StyledElement.

Definition

Namespace: Avalonia.Controls
Assembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public class Classes : AvaloniaList<string>, 
	IPseudoClasses
Inheritance
Object    AvaloniaListString    Classes
Implements
IPseudoClasses

Remarks

Similar to CSS, each control may have any number of styling classes applied.

Properties

Capacity Gets or sets the total number of elements the internal data structure can hold without resizing.
(Inherited from AvaloniaListT)
Count Gets the number of items in the collection.
(Inherited from AvaloniaListT)
ItemInt32 Gets or sets the item at the specified index.
(Inherited from AvaloniaListT)
ResetBehavior Gets or sets the reset behavior of the list.
(Inherited from AvaloniaListT)
Validate Gets or sets a validation routine that can be used to validate items before they are added.
(Inherited from AvaloniaListT)

Methods

Add(String) Adds a style class to the collection.
(Overrides AvaloniaListTAdd(T))
AddRange(IEnumerableString) Adds a style classes to the collection.
(Overrides AvaloniaListTAddRange(IEnumerableT))
Clear Removes all non-pseudoclasses from the collection.
(Overrides AvaloniaListTClear)
Contains(T) Tests if the collection contains the specified item.
(Inherited from AvaloniaListT)
CopyTo(T, Int32) Copies the collection's contents to an array.
(Inherited from AvaloniaListT)
EnsureCapacity(Int32) Ensures that the capacity of the list is at least Capacity.
(Inherited from AvaloniaListT)
Equals(Object)Determines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetEnumerator
(Inherited from AvaloniaListT)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetRange(Int32, Int32) Gets a range of items from the collection.
(Inherited from AvaloniaListT)
GetTypeGets the Type of the current instance.
(Inherited from Object)
IndexOf(T) Gets the index of the specified item in the collection.
(Inherited from AvaloniaListT)
Insert(Int32, String) Inserts a style class into the collection.
(Overrides AvaloniaListTInsert(Int32, T))
InsertRange(Int32, IEnumerableString) Inserts style classes into the collection.
(Overrides AvaloniaListTInsertRange(Int32, IEnumerableT))
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Move(Int32, Int32) Moves an item to a new index.
(Inherited from AvaloniaListT)
MoveRange(Int32, Int32, Int32) Moves multiple items to a new index.
(Inherited from AvaloniaListT)
Parse(String) Parses a classes string.
Remove(String) Removes a style class from the collection.
(Overrides AvaloniaListTRemove(T))
RemoveAll(IEnumerableString) Removes style classes from the collection.
(Overrides AvaloniaListTRemoveAll(IEnumerableT))
RemoveAt(Int32) Removes a style class from the collection.
(Overrides AvaloniaListTRemoveAt(Int32))
RemoveRange(Int32, Int32) Removes style classes from the collection.
(Overrides AvaloniaListTRemoveRange(Int32, Int32))
Replace(IListString) Removes all non-pseudoclasses in the collection and adds a new set.
Set(String, Boolean) Adds a or removes a style class to/from the collection.
ToStringReturns a string that represents the current object.
(Inherited from Object)

Events

CollectionChanged Raised when a change is made to the collection's items.
(Inherited from AvaloniaListT)
PropertyChanged Raised when a property on the collection changes.
(Inherited from AvaloniaListT)

Extension Methods

Set(String, Boolean) Adds or removes a pseudoclass depending on a boolean value.
(Defined by PseudolassesExtensions)
Set(String, IObservableBoolean) Sets a pseudoclass depending on an observable trigger.
(Defined by ControlExtensions)

See Also