Table of Contents

Class UIElementTextAdapter

Namespace
Icy.Markup
Assembly
IcyUI.dll

The built-in adapter for UIElement-typed content properties: wraps the text in a TextBlock.

public sealed class UIElementTextAdapter : IMarkupTextAdapter
Inheritance
UIElementTextAdapter
Implements
Inherited Members
Extension Methods

Remarks

The resulting TextBlock has no FontFamily of its own, and relies on DefaultFontFamily or FallbackFont to resolve one - configure at least one of those, or bare text renders as nothing.

Methods

Adapt(string, Type)

Produces the value to assign to a content property of targetType for text.

public object? Adapt(string text, Type targetType)

Parameters

text string

The element's text, already trimmed.

targetType Type

The type of the content property the text is being written into.

Returns

object

A value assignable to targetType.

CanAdapt(Type)

Determines whether this adapter can produce a value assignable to targetType.

public bool CanAdapt(Type targetType)

Parameters

targetType Type

The type of the content property the text is being written into.

Returns

bool

true when Adapt(string, Type) can handle this type.