Xamarin.Forms.BindableObject.SetBinding Method
Assigns a binding to a property.

Syntax

public void SetBinding (BindableProperty targetProperty, BindingBase binding)

Parameters

targetProperty
The BindableProperty on which to set a binding.
binding
The binding to set.

Remarks

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

C# Example

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

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0