- self
- The Xamarin.Forms.BindableObject.
- targetProperty
- The BindableProperty on which to set a bindinge.
- path
- A string indicating the property path to bind to.
- mode
- The Xamarin.Forms.BindingMode for the binding. This parameter is optional. Default is BindingMode.Default.
- converter
- An Xamarin.Forms.IValueConverter for the binding. This parameter is optional. Default is null.
- stringFormat
- A string used as stringFormat for the binding. This parameter is optional. Default is null.
The following example shows how to use the extension method to set a binding.
C# Example
var label = new Label ();
label.SetBinding (Label.TextProperty, "Name");
label.BindingContext = new {Name = "John Doe", Company = "Xamarin"};
Debug.WriteLine (label.Text); //prints "John Doe"