Table of Contents

Interface IMarkupExtension

Namespace
Icy.Markup
Assembly
IcyUI.dll

Computes a value for a markup attribute or element written as {Name ...}, instead of the loader converting the text directly.

public interface IMarkupExtension
Extension Methods

Remarks

An extension is a plain object, constructed through Activator like any other markup type, with its properties set from the arguments written inside the braces - so {Binding Path=Name, Mode=TwoWay} constructs a BindingExtension and sets its Path and Mode properties before calling ProvideValue(MarkupExtensionContext). Register one under a name with RegisterExtension<T>(string?).

The single positional argument some extensions accept ({Binding Name} rather than {Binding Path=Name}) is declared with MarkupExtensionDefaultPropertyAttribute.

Methods

ProvideValue(MarkupExtensionContext)

Computes the value the loader should use.

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.