Skip to main content

ResourceProvider Class

Definition

Assembly:Avalonia.Base
Package:Avalonia

Base implementation for IResourceProvider interface. Includes Owner property management.

public class ResourceProvider

Inheritance: object -> AvaloniaObject -> ResourceProvider

Constructors

NameDescription
ResourceProvider (2 overloads)No summary available.

ResourceProvider overloads

ResourceProvider Constructor

public ResourceProvider()

ResourceProvider Constructor

public ResourceProvider(Avalonia.Controls.IResourceHost owner)
Parameters

owner Avalonia.Controls.IResourceHost

Methods

NameDescription
TryGetResourceNo summary available.
Bind (8 overloads)Binds a Avalonia.AvaloniaProperty to an Avalonia.Data.BindingBase. Inherited from AvaloniaObject.
CheckAccessReturns a value indicating whether the current thread is the UI thread. Inherited from AvaloniaObject.
ClearValue (4 overloads)Clears a Avalonia.AvaloniaProperty's local value. Inherited from AvaloniaObject.
CoerceValueCoerces the specified Avalonia.AvaloniaProperty. Inherited from AvaloniaObject.
EqualsCompares two objects using reference equality. Inherited from AvaloniaObject.
GetBaseValueInherited from AvaloniaObject.
GetHashCodeGets the hash code for the object. Inherited from AvaloniaObject.
GetValue (3 overloads)Gets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject.
IsAnimatingChecks whether a Avalonia.AvaloniaProperty is animating. Inherited from AvaloniaObject.
IsSetChecks whether a Avalonia.AvaloniaProperty is set on this object. Inherited from AvaloniaObject.
SetCurrentValue (2 overloads)Sets the value of a dependency property without changing its value source. Inherited from AvaloniaObject.
SetValue (3 overloads)Sets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject.
VerifyAccessChecks that the current thread is the UI thread and throws if not. Inherited from AvaloniaObject.

TryGetResource Method

public bool TryGetResource(object key, Avalonia.Styling.ThemeVariant theme, object& value)

Parameters

key object

theme Avalonia.Styling.ThemeVariant

value object&

Returns

bool

Properties

NameDescription
HasResourcesGets a value indicating whether the object has resources.
OwnerGets the owner of the resource provider.
DispatcherReturns the Avalonia.AvaloniaObject.Dispatcher that this Avalonia.AvaloniaObject is associated with. Inherited from AvaloniaObject.
ItemInherited from AvaloniaObject.

HasResources Property

Gets a value indicating whether the object has resources.

public bool HasResources { get; set; }

Owner Property

Gets the owner of the resource provider.

public Avalonia.Controls.IResourceHost Owner { get; set; }

Remarks

If multiple owners are added, returns the first.

Events

NameDescription
OwnerChangedRaised when the Avalonia.Controls.IResourceProvider.Owner of the resource provider changes.
PropertyChangedRaised when a Avalonia.AvaloniaProperty value changes on this object. Inherited from AvaloniaObject.

OwnerChanged Event

Raised when the Avalonia.Controls.IResourceProvider.Owner of the resource provider changes.

public event EventHandler OwnerChanged