Table of Contents

Class Translate

Namespace
Tlumach.Avalonia
Assembly
Tlumach.Avalonia.dll

A XAML markup extension that binds a property to the text of a translation unit and updates the property when the culture of the unit's translation manager changes or when NotifyPlaceholdersUpdated() is called.

Usage: Text="{tlumach:Translate {x:Static translations:Strings.Hello}}".

public sealed class Translate : MarkupExtension
Inheritance
MarkupExtension
Translate
Inherited Members

Constructors

Translate(TranslationUnit)

Initializes a new instance of the Translate class.

public Translate(TranslationUnit translationUnit)

Parameters

translationUnit TranslationUnit

The translation unit whose text the target property receives.

Exceptions

ArgumentNullException

translationUnit is null.

Methods

ProvideValue(IServiceProvider)

Returns a binding to the Value observable of the translation unit.

public override object ProvideValue(IServiceProvider serviceProvider)

Parameters

serviceProvider IServiceProvider

The service provider of the XAML parser. It is not used.

Returns

object

The binding to apply to the target property.