BindablePropertyKey Classe

Définition

Clé secrète d’un BindableProperty, utilisée pour implémenter des propriétés pouvant être liées en lecture seule.

public ref class BindablePropertyKey sealed
public sealed class BindablePropertyKey
type BindablePropertyKey = class
Public NotInheritable Class BindablePropertyKey
Héritage
BindablePropertyKey

Remarques

L’exemple suivant montre la création d’une BindablePropertyKey. L’accès en écriture est internal alors que l’accès en lecture est 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); } 
  }
}

Propriétés

Nom Description
BindableProperty

Obtient l’objet BindableProperty associé à cette clé.

S’applique à