Styles Class

Summary

A style that consists of a number of child styles.
Namespace
Avalonia.Styling
Interfaces
Base Types
Derived Types
graph BT Type-->Base0["AvaloniaObject"] click Base0 "/api/Avalonia/AvaloniaObject" Base0-->Base1["object"] Type-.->Interface0["IAvaloniaObject"] click Interface0 "/api/Avalonia/IAvaloniaObject" Type-.->Interface1["IAvaloniaObjectDebug"] click Interface1 "/api/Avalonia.Diagnostics/IAvaloniaObjectDebug" Type-.->Interface2["IValueSink"] Type-.->Interface3["IAvaloniaList<IStyle>"] Type-.->Interface4["IList<IStyle>"] Type-.->Interface5["ICollection<IStyle>"] Type-.->Interface6["IAvaloniaReadOnlyList<IStyle>"] Type-.->Interface7["IReadOnlyList<IStyle>"] Type-.->Interface8["IReadOnlyCollection<IStyle>"] Type-.->Interface9["IEnumerable<IStyle>"] Type-.->Interface10["IEnumerable"] Type-.->Interface11["INotifyCollectionChanged"] Type-.->Interface12["INotifyPropertyChanged"] Type-.->Interface13["IStyle"] click Interface13 "/api/Avalonia.Styling/IStyle" Type-.->Interface14["IResourceProvider"] click Interface14 "/api/Avalonia.Controls/IResourceProvider" Type-.->Interface15["IResourceNode"] click Interface15 "/api/Avalonia.Controls/IResourceNode" Type["Styles"] class Type type-node Derived0["DefaultTheme"]-->Type click Derived0 "/api/Avalonia.Themes.Default/DefaultTheme" Derived1["FluentControls"]-->Type click Derived1 "/api/Avalonia.Themes.Fluent.Controls/FluentControls"

Syntax

public class Styles : AvaloniaObject, IAvaloniaObject, IAvaloniaObjectDebug, IValueSink, 
    IAvaloniaList<IStyle>, IList<IStyle>, ICollection<IStyle>, IAvaloniaReadOnlyList<IStyle>, 
    IReadOnlyList<IStyle>, IReadOnlyCollection<IStyle>, IEnumerable<IStyle>, IEnumerable, 
    INotifyCollectionChanged, INotifyPropertyChanged, IStyle, IResourceProvider, IResourceNode

Constructors

Events

Name Type Summary
CollectionChanged NotifyCollectionChangedEventHandler?
OwnerChanged EventHandler?
PropertyChanged EventHandler<AvaloniaPropertyChangedEventArgs>
Raised when a AvaloniaProperty value changes on this object.
Inherited from AvaloniaObject

Properties

Name Value Summary
Count int
InheritanceParent IAvaloniaObject
Gets or sets the parent object that inherited AvaloniaProperty values are inherited from.
Inherited from AvaloniaObject
Owner IResourceHost?
Resources IResourceDictionary
Gets or sets a dictionary of style resources.
this[AvaloniaProperty] object
Gets or sets the value of a AvaloniaProperty.
Inherited from AvaloniaObject
this[IndexerDescriptor] IBinding
Gets or sets a binding for a AvaloniaProperty.
Inherited from AvaloniaObject
this[int] IStyle

Methods

Name Value Summary
Add(IStyle) void
AddRange(IEnumerable<IStyle>) void
Adds multiple items to the collection.
BeginBatchUpdate() void
Inherited from AvaloniaObject
Bind<T>(DirectPropertyBase<T>, IObservable<BindingValue<T>>) IDisposable
Binds a AvaloniaProperty to an observable.
Inherited from AvaloniaObject
Bind<T>(StyledPropertyBase<T>, IObservable<BindingValue<T>>, BindingPriority) IDisposable
Binds a AvaloniaProperty to an observable.
Inherited from AvaloniaObject
CheckAccess() bool
Inherited from AvaloniaObject
Clear() void
ClearValue(AvaloniaProperty) void
Clears a AvaloniaProperty's local value.
Inherited from AvaloniaObject
ClearValue<T>(AvaloniaProperty<T>) void
Clears a AvaloniaProperty's local value.
Inherited from AvaloniaObject
ClearValue<T>(DirectPropertyBase<T>) void
Clears a AvaloniaProperty's local value.
Inherited from AvaloniaObject
ClearValue<T>(StyledPropertyBase<T>) void
Clears a AvaloniaProperty's local value.
Inherited from AvaloniaObject
CoerceValue<T>(StyledPropertyBase<T>) void
Coerces the specified AvaloniaProperty.
Inherited from AvaloniaObject
Contains(IStyle) bool
CopyTo(IStyle[], int) void
EndBatchUpdate() void
Inherited from AvaloniaObject
Equals(object) bool
Compares two objects using reference equality.
Inherited from AvaloniaObject
GetBaseValue<T>(StyledPropertyBase<T>, BindingPriority) Optional<T>
Gets an AvaloniaProperty base value.
Inherited from AvaloniaObject
GetEnumerator() AvaloniaList<IStyle>.Enumerator
GetHashCode() int
Gets the hash code for the object.
Inherited from AvaloniaObject
GetValue(AvaloniaProperty) object
Gets a AvaloniaProperty value.
Inherited from AvaloniaObject
GetValue<T>(DirectPropertyBase<T>) T
Gets a AvaloniaProperty value.
Inherited from AvaloniaObject
GetValue<T>(StyledPropertyBase<T>) T
Gets a AvaloniaProperty value.
Inherited from AvaloniaObject
IndexOf(IStyle) int
Insert(int, IStyle) void
InsertRange(int, IEnumerable<IStyle>) void
Inserts multiple items at the specified index.
IsAnimating(AvaloniaProperty) bool
Checks whether a AvaloniaProperty is animating.
Inherited from AvaloniaObject
IsSet(AvaloniaProperty) bool
Checks whether a AvaloniaProperty is set on this object.
Inherited from AvaloniaObject
Move(int, int) void
Moves an item to a new index.
MoveRange(int, int, int) void
Moves multiple items to a new index.
Remove(IStyle) bool
RemoveAll(IEnumerable<IStyle>) void
Removes multiple items from the collection.
RemoveAt(int) void
RemoveRange(int, int) void
Removes a range of elements from the collection.
SetValue(AvaloniaProperty, object, BindingPriority) void
Sets a AvaloniaProperty value.
Inherited from AvaloniaObject
SetValue<T>(DirectPropertyBase<T>, T) void
Sets a AvaloniaProperty value.
Inherited from AvaloniaObject
SetValue<T>(StyledPropertyBase<T>, T, BindingPriority) IDisposable
Sets a AvaloniaProperty value.
Inherited from AvaloniaObject
TryAttach(IStyleable, IStyleHost?) SelectorMatchResult
TryGetResource(object, object?) bool
Tries to find a resource within the object.
VerifyAccess() void
Inherited from AvaloniaObject

Extension Methods

Name Value Summary
Bind(AvaloniaProperty, IObservable<BindingValue<object>>, BindingPriority) IDisposable
Binds a AvaloniaProperty to an observable.
Bind<T>(AvaloniaProperty<T>, IObservable<BindingValue<T>>, BindingPriority) IDisposable
Binds a AvaloniaProperty to an observable.
CreateDerivedList<IStyle, TDerived>(Func<IStyle, TDerived>) IAvaloniaReadOnlyList<TDerived>
ForEachItem<IStyle>(Action<int, IStyle>, Action<int, IStyle>, Action, bool) IDisposable
Invokes an action for each item in a collection and subsequently each item added or removed from the collection.
ForEachItem<IStyle>(Action<IStyle>, Action<IStyle>, Action, bool) IDisposable
Invokes an action for each item in a collection and subsequently each item added or removed from the collection.
GetBindingObservable(AvaloniaProperty) IObservable<BindingValue<object>>
Gets an observable for a AvaloniaProperty.
GetBindingObservable<T>(AvaloniaProperty<T>) IObservable<BindingValue<T>>
Gets an observable for a AvaloniaProperty.
GetBindingSubject(AvaloniaProperty, BindingPriority) ISubject<BindingValue<object>>
Gets a subject for a AvaloniaProperty.
GetBindingSubject<T>(AvaloniaProperty<T>, BindingPriority) ISubject<BindingValue<T>>
Gets a subject for a AvaloniaProperty.
GetDiagnostic(AvaloniaProperty) AvaloniaPropertyValue
Gets a diagnostic for a AvaloniaProperty on a AvaloniaObject.
GetObservable(AvaloniaProperty) IObservable<object>
Gets an observable for a AvaloniaProperty.
GetObservable<T>(AvaloniaProperty<T>) IObservable<T>
Gets an observable for a AvaloniaProperty.
GetPropertyChangedObservable(AvaloniaProperty) IObservable<AvaloniaPropertyChangedEventArgs>
Gets an observable that listens for property changed events for an AvaloniaProperty.
GetResourceObservable(object, Func<object?, object?>?) IObservable<object?>
GetSubject(AvaloniaProperty, BindingPriority) ISubject<object>
Gets a subject for a AvaloniaProperty.
GetSubject<T>(AvaloniaProperty<T>, BindingPriority) ISubject<T>
Gets a subject for a AvaloniaProperty.
TrackItemPropertyChanged<IStyle>(Action<Tuple<object, PropertyChangedEventArgs>>) IDisposable
Listens for property changed events from all items in a collection.