BindableObject.SetBinding(BindableProperty, BindingBase) メソッド

定義

プロパティにバインディングを割り当てます。

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

パラメーター

targetProperty
BindableProperty

バインディングを設定する BindableProperty。

binding
BindingBase

設定するバインディング。

注釈

次の例は、バインドを プロパティに設定する方法を示しています。

var label = new Label ();
label.SetBinding (Label.TextProperty, new Binding ("Name"));
label.BindingContext = new {
    Name = "John Doe",
    Company = "Xamarin"
};

Debug.WriteLine (label.Text); // prints "John Doe"

適用対象