Xamarin.Forms Guides | Samples

Xamarin.Forms.BindablePropertyKey Class

The secret key to a BindableProperty, used to implement a BindableProperty with restricted write access.

See Also: BindablePropertyKey

Syntax

public sealed class BindablePropertyKey

Remarks

The following example shows the creation of a BindablePropertyKey. Write access is internal while read access is public.

C# Example

class Bindable : BindableObject
{
  internal static readonly BindablePropertyKey FooPropertyKey = 
    BindableProperty.CreateReadOnly<Bindable, string> (w => w.Foo, default(string));

  public static readonly BindableProperty FooProperty = FooPropertyKey.BindableProperty;

  public string Foo {
    get { return (string)GetValue (FooProperty); }
    internal set { SetValue (FooPropertyKey, value); } 
  }
}

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, 1.4.0.0, 1.5.0.0, 2.0.0.0

The members of Xamarin.Forms.BindablePropertyKey are listed below.

See Also: Object

Public Properties

[read-only]
BindablePropertyBindableProperty. Gets the BindableProperty.