Skip to main content

ResourceInclude Class

Definition​

Assembly:Avalonia.Markup.Xaml
Package:Avalonia

Loads a resource dictionary from a specified URL.

public class ResourceInclude

Inheritance: object -> ResourceInclude

Derived types:MergeResourceInclude

Remarks​

If used from the XAML code, it is replaced with direct resource dictionary reference. When used in runtime, this type might be unsafe with trimming and AOT.

Constructors​

NameDescription
ResourceInclude (2 overloads)Initializes a new instance of the Avalonia.Markup.Xaml.Styling.ResourceInclude class.

ResourceInclude overloads​

ResourceInclude Constructor​

Initializes a new instance of the Avalonia.Markup.Xaml.Styling.ResourceInclude class.

public ResourceInclude(IServiceProvider serviceProvider)
Parameters​

serviceProvider IServiceProvider

The XAML service provider.

ResourceInclude Constructor​

Initializes a new instance of the Avalonia.Markup.Xaml.Styling.ResourceInclude class.

public ResourceInclude(Uri baseUri)
Parameters​

baseUri Uri

The base URL for the XAML context.

Methods​

NameDescription
TryGetResourceNo summary available.

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
LoadedGets the loaded resource dictionary.
OwnerNo summary available.
SourceGets or sets the source URL.

Loaded Property​

Gets the loaded resource dictionary.

public Avalonia.Controls.IResourceDictionary Loaded { get; set; }

Owner Property​

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

Source Property​

Gets or sets the source URL.

public Uri Source { get; set; }

Events​

NameDescription
OwnerChangedNo summary available.

OwnerChanged Event​

public event EventHandler OwnerChanged