BindablePropertyKey 类

定义

BindableProperty 的密钥,用于通过受限制的写入访问权限实现 BindableProperty。

public sealed class BindablePropertyKey
type BindablePropertyKey = class
继承
System.Object
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。

适用于