- propertyKey
- The BindablePropertyKey on which to assign a value.
- value
- The value to set.
This method and Xamarin.Forms.BindablePropertyKey are useful to implement BindableProperties with limited write access. The write access is limited to the scope of the BindablePropertyKey.
The following example shows how to declare a BindableProperty with "internal" write access.
C# Example
class MyBindable : BindableObject
{
internal static readonly BindablePropertyKey MyPropertyKey =
BindableProperty.CreateReadOnly<MyBindable, string> (w => w.My, default(string));
public static readonly BindableProperty MyProperty = MyPropertyKey.BindableProperty;
public string My {
get { return (string)GetValue (MyProperty); }
internal set { SetValue (MyPropertyKey, value); }
}
}