Table of Contents

Class StringFormatValueConverter

Namespace
Avalonia.Data.Converters
Assembly
Avalonia.Base.dll

A value converter which calls Format(string, object)

public class StringFormatValueConverter : IValueConverter
Inheritance
StringFormatValueConverter
Implements
Inherited Members

Constructors

StringFormatValueConverter(string, IValueConverter?)

Initializes a new instance of the StringFormatValueConverter class.

public StringFormatValueConverter(string format, IValueConverter? inner)

Parameters

format string

The format string.

inner IValueConverter

An optional inner converter to be called before the format takes place.

Properties

Format

Gets the format string.

public string Format { get; }

Property Value

string

Inner

Gets an inner value converter which will be called before the string format takes place.

public IValueConverter? Inner { get; }

Property Value

IValueConverter

Methods

Convert(object?, Type, object?, CultureInfo)

Converts a value.

public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)

Parameters

value object

The value to convert.

targetType Type

The type of the target.

parameter object

A user-defined parameter.

culture CultureInfo

The culture to use.

Returns

object

The converted value.

Remarks

This method should not throw exceptions. If the value is not convertible, return a BindingNotification in an error state. Any exceptions thrown will be treated as an application exception.

ConvertBack(object?, Type, object?, CultureInfo)

Converts a value.

public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)

Parameters

value object

The value to convert.

targetType Type

The type of the target.

parameter object

A user-defined parameter.

culture CultureInfo

The culture to use.

Returns

object

The converted value.

Remarks

This method should not throw exceptions. If the value is not convertible, return a BindingNotification in an error state. Any exceptions thrown will be treated as an application exception.