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); }
}
}
屬性
| 名稱 | Description |
|---|---|
| BindableProperty |
會取得與此鍵相關的 BindableProperty。 |