Skip to main content

StyleInclude Class

Definition

Assembly:Avalonia.Markup.Xaml
Package:Avalonia

Includes a style from a URL.

public class StyleInclude

Inheritance: object -> StyleInclude

Remarks

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

Constructors

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

StyleInclude overloads

StyleInclude Constructor

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

public StyleInclude(IServiceProvider serviceProvider)
Parameters

serviceProvider IServiceProvider

The XAML service provider.

StyleInclude Constructor

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

public StyleInclude(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 style.
OwnerNo summary available.
SourceGets or sets the source URL.

Loaded Property

Gets the loaded style.

public Avalonia.Styling.IStyle 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