共用方式為


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); } 
  }
}

屬性

名稱 Description
BindableProperty

會取得與此鍵相關的 BindableProperty。

適用於