AvaloniaObjectExtensions.

Bind(IAvaloniaObject, AvaloniaProperty, IBinding, object) Method

Summary

Binds a property on an IAvaloniaObject to an IBinding.
Namespace
Avalonia
Containing Type
AvaloniaObjectExtensions

Syntax

public static IDisposable Bind(this IAvaloniaObject target, AvaloniaProperty property, IBinding binding, object anchor = null)

Parameters

Name Type Description
target IAvaloniaObject The object.
property AvaloniaProperty The property to bind.
binding IBinding The binding.
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 provice this context.

Return Value

Type Description
IDisposable An IDisposable which can be used to cancel the binding.