Skip to main content

Classes Class

Holds a collection of style classes for an StyledElement.

Definition

Namespace: Avalonia.Controls
Assembly: Avalonia.Base (in Avalonia.Base.dll)

public class Classes : AvaloniaList<string>, 
IPseudoClasses
View Source
InheritanceObjectAvaloniaList(String) → Classes
ImplementsIPseudoClasses

Remarks

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

Constructors

Classes()Initializes a new instance of the Classes class.
Classes(IEnumerable(String))Initializes a new instance of the Classes class.
Classes(String[])Initializes a new instance of the Classes class.

Properties

CapacityGets or sets the total number of elements the internal data structure can hold without resizing.
(Inherited from AvaloniaList(T))
CountGets the number of items in the collection.
(Inherited from AvaloniaList(T))
Item(Int32)Gets or sets the item at the specified index.
(Inherited from AvaloniaList(T))
ResetBehaviorGets or sets the reset behavior of the list.
(Inherited from AvaloniaList(T))
ValidateGets or sets a validation routine that can be used to validate items before they are added.
(Inherited from AvaloniaList(T))

Methods

Add(String)Adds a style class to the collection.
(Overrides AvaloniaList(T).Add(T))
AddRange(IEnumerable(String))Adds a style classes to the collection.
(Overrides AvaloniaList(T).AddRange(IEnumerable(T)))
Clear()Removes all non-pseudoclasses from the collection.
(Overrides AvaloniaList(T).Clear())
Contains(T)Tests if the collection contains the specified item.
(Inherited from AvaloniaList(T))
CopyTo(T[], Int32)Copies the collection's contents to an array.
(Inherited from AvaloniaList(T))
EnsureCapacity(Int32)Ensures that the capacity of the list is at least Capacity.
(Inherited from AvaloniaList(T))
Equals(Object)Determines whether the specified object is equal to the current object.
(Inherited from Object)
Finalize()Allows 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 AvaloniaList(T))
GetHashCode()Serves as the default hash function.
(Inherited from Object)
GetRange(Int32, Int32)Gets a range of items from the collection.
(Inherited from AvaloniaList(T))
GetType()Gets the Type of the current instance.
(Inherited from Object)
IndexOf(T)Gets the index of the specified item in the collection.
(Inherited from AvaloniaList(T))
Insert(Int32, String)Inserts a style class into the collection.
(Overrides AvaloniaList(T).Insert(Int32, T))
InsertRange(Int32, IEnumerable(String))Inserts style classes into the collection.
(Overrides AvaloniaList(T).InsertRange(Int32, IEnumerable(T)))
MemberwiseClone()Creates a shallow copy of the current Object.
(Inherited from Object)
Move(Int32, Int32)Moves an item to a new index.
(Inherited from AvaloniaList(T))
MoveRange(Int32, Int32, Int32)Moves multiple items to a new index.
(Inherited from AvaloniaList(T))
Parse(String)Parses a classes string.
Remove(String)Removes a style class from the collection.
(Overrides AvaloniaList(T).Remove(T))
RemoveAll(IEnumerable(String))Removes style classes from the collection.
(Overrides AvaloniaList(T).RemoveAll(IEnumerable(T)))
RemoveAt(Int32)Removes a style class from the collection.
(Overrides AvaloniaList(T).RemoveAt(Int32))
RemoveRange(Int32, Int32)Removes style classes from the collection.
(Overrides AvaloniaList(T).RemoveRange(Int32, Int32))
Replace(IList(String))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.
ToString()Returns a string that represents the current object.
(Inherited from Object)

Events

CollectionChangedRaised when a change is made to the collection's items.
(Inherited from AvaloniaList(T))
PropertyChangedRaised when a property on the collection changes.
(Inherited from AvaloniaList(T))

Extension Methods

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

See Also

Reference

Avalonia.Controls Namespace