Styles Class

Summary

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

Syntax

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

Constructors

Name Summary
Styles()

Events

Name Type Summary
CollectionChanged NotifyCollectionChangedEventHandler
PropertyChanged EventHandler<AvaloniaPropertyChangedEventArgs>
Raised when a AvaloniaProperty value changes on this object.
Inherited from AvaloniaObject
ResourcesChanged EventHandler<ResourcesChangedEventArgs>
Raised when resources in the provider are changed.

Properties

Name Value Summary
Count int
Gets the number of items in the list.
HasResources bool
Gets a value indicating whether the element has resources.
InheritanceParent IAvaloniaObject
Gets or sets the parent object that inherited AvaloniaProperty values are inherited from.
Inherited from AvaloniaObject
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
Gets or sets the element at the specified index.

Methods

Name Value Summary
Add(IStyle) void
AddRange(IEnumerable<IStyle>) void
Adds multiple items to the collection.
AffectsValidation(AvaloniaProperty, AvaloniaProperty[]) void
Forces revalidation of properties when a property value changes.
Inherited from AvaloniaObject
static
Attach(IStyleable, IStyleHost) bool
Attaches the style to a control if the style's selector matches.
Bind(AvaloniaProperty, IObservable<object>, BindingPriority) IDisposable
Binds a AvaloniaProperty to an observable.
Inherited from AvaloniaObject
Bind<T>(AvaloniaProperty<T>, IObservable<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
Contains(IStyle) bool
CopyTo(IStyle[], int) void
Detach() void
GetEnumerator() IEnumerator<IStyle>
GetValue(AvaloniaProperty) object
Gets a AvaloniaProperty value.
Inherited from AvaloniaObject
GetValue<T>(AvaloniaProperty<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.
OnPropertyChanged(AvaloniaPropertyChangedEventArgs) void
Called when a avalonia property changes on the object.
Inherited from AvaloniaObject
RaisePropertyChanged(AvaloniaProperty, object, object, BindingPriority) void
Raises the PropertyChanged event.
Inherited from AvaloniaObject
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.
Revalidate(AvaloniaProperty) void
Forces the specified property to be revalidated.
Inherited from AvaloniaObject
SetAndRaise<T>(AvaloniaProperty<T>, T, AvaloniaObject.SetAndRaiseCallback<T>, T) bool
Sets the backing field for a direct avalonia property, raising the PropertyChanged event if the value has changed.
Inherited from AvaloniaObject
SetAndRaise<T>(AvaloniaProperty<T>, T, T) bool
Sets the backing field for a direct avalonia property, raising the PropertyChanged event if the value has changed.
Inherited from AvaloniaObject
SetValue(AvaloniaProperty, object, BindingPriority) void
Sets a AvaloniaProperty value.
Inherited from AvaloniaObject
SetValue<T>(AvaloniaProperty<T>, T, BindingPriority) void
Sets a AvaloniaProperty value.
Inherited from AvaloniaObject
TryGetResource(string, object) bool
Tries to find a resource within the provider.
UpdateDataValidation(AvaloniaProperty, BindingNotification) void
Called to update the validation state for properties for which data validation is enabled.
Inherited from AvaloniaObject
VerifyAccess() void
Inherited from AvaloniaObject

Extension Methods

Name Value Summary
Bind(AvaloniaProperty, IBinding, object) IDisposable
Binds a property on an IAvaloniaObject to an IBinding.
CreateDerivedList<IStyle, TDerived>(Func<IStyle, TDerived>) IAvaloniaReadOnlyList<TDerived>
FindResource(string) object
Finds the specified resource by searching up the logical tree and then global styles.
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.
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(string) 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.
TryFindResource(string, object) bool
Tries to the specified resource by searching up the logical tree and then global styles.