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
stringThe format string.
inner
IValueConverterAn optional inner converter to be called before the format takes place.
Properties
Format
Gets the format string.
public string Format { get; }
Property Value
Inner
Gets an inner value converter which will be called before the string format takes place.
public IValueConverter? Inner { get; }
Property Value
Methods
Convert(object?, Type, object?, CultureInfo)
Converts a value.
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
Parameters
value
objectThe value to convert.
targetType
TypeThe type of the target.
parameter
objectA user-defined parameter.
culture
CultureInfoThe 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
objectThe value to convert.
targetType
TypeThe type of the target.
parameter
objectA user-defined parameter.
culture
CultureInfoThe 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.