Table of Contents

Class StaticResourceExtension

Namespace
Icy.Markup.Extensions
Assembly
IcyUI.dll

{StaticResource Key}: resolves a named resource by walking outward from the innermost element currently under construction (see ElementStack) to the document root, checking each element's own Resources in turn.

[MarkupExtensionDefaultProperty("Key")]
public sealed class StaticResourceExtension : IMarkupExtension
Inheritance
StaticResourceExtension
Implements
Inherited Members
Extension Methods

Remarks

Resolved once, at load time - not re-evaluated if the resource dictionary changes afterward (there is no mechanism for that yet; this matches how ContentPropertyAttribute content and every other non-{Binding} value in markup is a one-time assignment).

Properties

Key

Gets or sets the key to look up.

public string Key { get; set; }

Property Value

string

Methods

ProvideValue(MarkupExtensionContext)

Computes the value the loader should use.

public object? ProvideValue(MarkupExtensionContext context)

Parameters

context MarkupExtensionContext

The property being resolved, and what the loader knows about the document.

Returns

object

The value to assign, converted the same way an ordinary attribute value would be; or Unset when the extension already applied its own effect (typically by binding the property itself) and nothing further should be assigned.

Exceptions

MarkupException

No ancestor's Resources (own entries or merged dictionaries) has an entry for Key.