Condividi tramite


BindablePropertyKey Classe

Definizione

La chiave privata di una BindableProperty usata per implementare una BindableProperty con accesso limitato in scrittura.

public ref class BindablePropertyKey sealed
public sealed class BindablePropertyKey
type BindablePropertyKey = class
Public NotInheritable Class BindablePropertyKey
Ereditarietà
BindablePropertyKey

Commenti

Nell'esempio seguente viene illustrata la creazione di bindablePropertyKey. L'accesso in scrittura è internal mentre l'accesso in lettura è public.

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); } 
  }
}

Proprietà

BindableProperty

Ottiene la BindableProperty.

Si applica a