共用方式為


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。

適用於