- property
- The BindableProperty for which to get the value.
The value that is contained the Xamarin.Forms.BindableProperty.
BindableObject.GetValue and BindableObject.SetValue are used to access the values of properties that are implemented by a Xamarin.Forms.BindableProperty. That is, application developers typically provide an interface for a bound property by defining public property whose get accessor casts the result of BindableObject.GetValue to the appropriate type and returns it, and whose get accessor uses BindableObject.SetValue to set the value on the correct property. Application developers should perform no other steps in the public property that defines the interface of the bound property.
The following example shows how to create a bindable property interface for an implementation that will be provided in the target property when the binding is made at run time.
C# Example
class MyBindable : BindableObject
{
public static readonly BindableProperty MyProperty =
BindableProperty.Create<MyBindable, string> (w => w.My, default(string));
public string My {
get { return (string)GetValue (MyProperty); }
set { SetValue (MyProperty, value); }
}
}