BindablePropertyKey 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
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。 |