Udostępnij za pośrednictwem


BindablePropertyKey Klasa

Definicja

Klucz tajny do właściwości BindableProperty używany do implementowania właściwości możliwych do powiązania tylko do odczytu.

public ref class BindablePropertyKey sealed
public sealed class BindablePropertyKey
type BindablePropertyKey = class
Public NotInheritable Class BindablePropertyKey
Dziedziczenie
BindablePropertyKey

Uwagi

W poniższym przykładzie pokazano tworzenie elementu BindablePropertyKey. Dostęp do zapisu jest internal , gdy dostęp do odczytu to 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); } 
  }
}

Właściwości

Nazwa Opis
BindableProperty

Pobiera właściwość BindableProperty skojarzona z tym kluczem.

Dotyczy