Skip to main content

Bind(AvaloniaObject, AvaloniaProperty, IBinding, Object) Method

Obsolete.

Use AvaloniaObject.Bind(AvaloniaProperty, IBinding

Binds a property on an AvaloniaObject to an IBinding.

Definition

Namespace: Avalonia
Assembly: Avalonia.Base (in Avalonia.Base.dll)

[ObsoleteAttribute("Use AvaloniaObject.Bind(AvaloniaProperty, IBinding")]
public static IDisposable Bind(
this AvaloniaObject target,
AvaloniaProperty property,
IBinding binding,
Object? anchor = null
)

Parameters

  AvaloniaObject
The object.
  AvaloniaProperty
The property to bind.
  IBinding
The binding.
  Object  (Optional)
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.

Return Value

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

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type AvaloniaObject. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also

Reference

AvaloniaObjectExtensions Class
Bind Overload
Avalonia Namespace