Поделиться через


BindablePropertyKey Класс

Определение

Секретный ключ для bindableProperty, используемый для реализации привязываемых свойств только для чтения.

public ref class BindablePropertyKey sealed
public sealed class BindablePropertyKey
type BindablePropertyKey = class
Public NotInheritable Class BindablePropertyKey
Наследование
BindablePropertyKey

Комментарии

В следующем примере показано создание bindablePropertyKey. Доступ на запись находится internal во время доступа на 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); } 
  }
}

Свойства

Имя Описание
BindableProperty

Возвращает bindableProperty, связанный с этим ключом.

Применяется к