通过


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。

适用于