Table of Contents

Class MultiBinding

Namespace
Avalonia.Data
Assembly
Avalonia.Markup.dll

A XAML binding that calculates an aggregate value from multiple child Bindings.

public class MultiBinding : IBinding
Inheritance
MultiBinding
Implements
Inherited Members

Constructors

MultiBinding()

public MultiBinding()

Properties

Bindings

Gets the collection of child bindings.

[Content]
[AssignBinding]
public IList<IBinding> Bindings { get; set; }

Property Value

IList<IBinding>

Converter

Gets or sets the IMultiValueConverter to use.

public IMultiValueConverter? Converter { get; set; }

Property Value

IMultiValueConverter

ConverterCulture

Gets or sets the culture in which to evaluate the converter.

[TypeConverter(typeof(CultureInfoIetfLanguageTagConverter))]
public CultureInfo? ConverterCulture { get; set; }

Property Value

CultureInfo

The default value is null.

Remarks

If this property is not set then CurrentCulture will be used.

ConverterParameter

Gets or sets a parameter to pass to Converter.

public object? ConverterParameter { get; set; }

Property Value

object

FallbackValue

Gets or sets the value to use when the binding is unable to produce a value.

public object FallbackValue { get; set; }

Property Value

object

Mode

Gets or sets the binding mode.

public BindingMode Mode { get; set; }

Property Value

BindingMode

Priority

Gets or sets the binding priority.

public BindingPriority Priority { get; set; }

Property Value

BindingPriority

RelativeSource

Gets or sets the relative source for the binding.

public RelativeSource? RelativeSource { get; set; }

Property Value

RelativeSource

StringFormat

Gets or sets the string format.

public string? StringFormat { get; set; }

Property Value

string

TargetNullValue

Gets or sets the value to use when the binding result is null.

public object TargetNullValue { get; set; }

Property Value

object

Methods

Initiate(AvaloniaObject, AvaloniaProperty?, object?, bool)

Initiates the binding on a target object.

public InstancedBinding? Initiate(AvaloniaObject target, AvaloniaProperty? targetProperty, object? anchor = null, bool enableDataValidation = false)

Parameters

target AvaloniaObject

The target instance.

targetProperty AvaloniaProperty

The target property. May be null.

anchor object

An optional anchor from which to locate required context. When binding to objects that are not in the logical tree, certain types of binding need an anchor into the tree in order to locate named controls or resources. The anchor parameter can be used to provide this context.

enableDataValidation bool

Whether data validation should be enabled.

Returns

InstancedBinding

A InstancedBinding or null if the binding could not be resolved.