BindableObject.SetBinding(BindableProperty, BindingBase) BindableObject.SetBinding(BindableProperty, BindingBase) Method

Definition

Assigns a binding to a property.

public void SetBinding (Xamarin.Forms.BindableProperty targetProperty, Xamarin.Forms.BindingBase binding);
member this.SetBinding : Xamarin.Forms.BindableProperty * Xamarin.Forms.BindingBase -> unit
Parameters
targetProperty
BindableProperty BindableProperty

The BindableProperty on which to set a binding.

binding
BindingBase BindingBase

The binding to set.

Remarks

The following example shows how to set a binding to a property:


var label = new Label ();
label.SetBinding (Label.TextProperty, new Binding ("Name"));

Applies to