In This Article

AvaloniaObjectExtensions Class

Provides extension methods for the Avalonia.AvaloniaObject type.

public static class AvaloniaObjectExtensions
Inheritance:
object object

Methods

BindToProperty(AvaloniaObject, AvaloniaProperty, AvaloniaObject, AvaloniaProperty, BindingMode)

Binds a dependency property to a property on the specified source.

public static void BindToProperty(this AvaloniaObject element, AvaloniaProperty targetProperty, AvaloniaObject source, AvaloniaProperty sourceProperty, BindingMode mode)
Parameter Type Description
element AvaloniaObject

The target element.

targetProperty AvaloniaProperty

The target property.

source AvaloniaObject

The source element.

sourceProperty AvaloniaProperty

The source property.

mode BindingMode

The binding mode.

BindToProperty(AvaloniaObject, AvaloniaProperty, object, AvaloniaProperty, BindingMode, IValueConverter?, object?)

Binds a dependency property to a property on the specified source.

public static IDisposable BindToProperty(this AvaloniaObject element, AvaloniaProperty targetProperty, object source, AvaloniaProperty sourceProperty, BindingMode mode, IValueConverter? converter = null, object? converterParameter = null)
Parameter Type Description
element AvaloniaObject

The target element.

targetProperty AvaloniaProperty

The target property.

source object

The source object.

sourceProperty AvaloniaProperty

The source property, which cannot be an attached property.

mode BindingMode

The binding mode.

converter IValueConverter

The value converter.

converterParameter object

The value converter parameter.

Returns

IDisposable:

An IDisposable that can be used to terminate the binding.

Exceptions

Type Condition
NotSupportedException

Inherited Members