Styles Class

Summary

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

Syntax

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

Constructors

Name Summary
Styles()

Events

Name Type Summary
ResourcesChanged EventHandler<ResourcesChangedEventArgs>
Raised when resources in the provider are changed.

Properties

Name Value Summary
HasResources bool
Gets a value indicating whether the element has resources.
Resources IResourceDictionary
Gets or sets a dictionary of style resources.

Methods

Name Value Summary
Attach(IStyleable, IStyleHost) void
Attaches the style to a control if the style's selector matches.
Detach() void
TryGetResource(string, object) bool
Tries to find a resource within the provider.

Extension Methods

Name Value Summary
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.
GetResourceObservable(string) IObservable<object>
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.