Style Class

Summary

Defines a style.
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["INotifyPropertyChanged"]-.->Type Interface3["ISetStyleParent"]-.->Type click Interface3 "/api/Avalonia.Styling/ISetStyleParent" Interface4["IStyle"]-.->Type click Interface4 "/api/Avalonia.Styling/IStyle" Interface5["IResourceNode"]-.->Type click Interface5 "/api/Avalonia.Controls/IResourceNode" Interface6["IResourceProvider"]-.->Type click Interface6 "/api/Avalonia.Controls/IResourceProvider" Type["Style"] class Type type-node

Syntax

public class Style : AvaloniaObject, IAvaloniaObject, IAvaloniaObjectDebug, INotifyPropertyChanged, 
    ISetStyleParent, IStyle, IResourceNode, IResourceProvider

Constructors

Name Summary
Style() Initializes a new instance of the Style class.
Style(Func<Selector, Selector>) Initializes a new instance of the Style class.

Events

Name Type Summary
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
Animations IList<IAnimation>
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.
Selector Selector
Gets or sets the style's selector.
Setters IList<ISetter>
Gets or sets the style's setters.
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

Methods

Name Value Summary
AffectsValidation(AvaloniaProperty, AvaloniaProperty[]) void
Forces revalidation of properties when a property value changes.
Inherited from AvaloniaObject
static
Attach(IStyleable, IStyleHost) void
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
ClearValue(AvaloniaProperty) void
Clears a AvaloniaProperty's local value.
Inherited from AvaloniaObject
Detach() void
GetValue(AvaloniaProperty) object
Gets a AvaloniaProperty value.
Inherited from AvaloniaObject
GetValue<T>(AvaloniaProperty<T>) T
Gets a AvaloniaProperty value.
Inherited from AvaloniaObject
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
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
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
ToString() string
Returns a string representation of the style.
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.
FindResource(string) object
Finds the specified resource by searching up the logical tree and then global styles.
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.
TryFindResource(string, object) bool
Tries to the specified resource by searching up the logical tree and then global styles.