Sdílet prostřednictvím


BindablePropertyKey Třída

Definice

Tajný klíč bindableProperty, který se používá k implementaci vlastností bindable jen pro čtení.

public ref class BindablePropertyKey sealed
public sealed class BindablePropertyKey
type BindablePropertyKey = class
Public NotInheritable Class BindablePropertyKey
Dědičnost
BindablePropertyKey

Poznámky

Následující příklad ukazuje vytvoření BindablePropertyKey. Přístup pro zápis je internal v době, kdy je publicpřístup pro čtení .

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

Vlastnosti

Name Description
BindableProperty

Získá BindableProperty přidružené k tomuto klíči.

Platí pro