PropertyPath 類別

定義

實作資料結構,用以將屬性描述為另一個屬性下或擁有者型別下的路徑。 屬性路徑用於資料系結至 物件。

public ref class PropertyPath sealed : DependencyObject
/// [Windows.Foundation.Metadata.Activatable(Microsoft.UI.Xaml.IPropertyPathFactory, 65536, "Microsoft.UI.Xaml.WinUIContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class PropertyPath final : DependencyObject
[Windows.Foundation.Metadata.Activatable(typeof(Microsoft.UI.Xaml.IPropertyPathFactory), 65536, "Microsoft.UI.Xaml.WinUIContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class PropertyPath : DependencyObject
Public NotInheritable Class PropertyPath
Inherits DependencyObject
繼承
Object Platform::Object IInspectable DependencyObject PropertyPath
屬性

備註

您可能使用 PropertyPath 物件的主要原因是複製現有的系結屬性,並在其他地方使用這些屬性:

  • 從現有的系結取得 Path (Binding.Path) 。
  • 使用該字串值來建構新的 PropertyPath
  • 建立新的 系結。 將 new PropertyPath 用於其 Binding.Path (,而且可能也會調整一些其他屬性) 。
  • 使用SetBinding將新的Binding套用至不同的物件屬性組合。

動畫目標也會使用屬性路徑概念,如 屬性路徑語法 主題中所述。 不過,動畫目標不會當做基礎類型使用 PropertyPath ,它會將路徑表示為字串,並針對所有相關 API 呼叫使用字串。

建構函式

PropertyPath(String)

根據路徑字串,初始化 PropertyPath 類別的新實例。

屬性

Dispatcher

一律會在Windows 應用程式 SDK應用程式中傳 null 回。 請改用 DispatcherQueue

(繼承來源 DependencyObject)
DispatcherQueue

DispatcherQueue取得與這個 物件相關聯的 。 DispatcherQueue表示即使程式碼是由非 UI 執行緒起始,也可以存取 DependencyObject UI 執行緒上的 設備。

(繼承來源 DependencyObject)
Path

取得這個 PropertyPath所保留的路徑值。

方法

ClearValue(DependencyProperty)

清除相依性屬性的本機值。

(繼承來源 DependencyObject)
GetAnimationBaseValue(DependencyProperty)

傳回為相依性屬性建立的任何基底值,如果動畫未使用中,則適用此屬性。

(繼承來源 DependencyObject)
GetValue(DependencyProperty)

DependencyObject傳回相依性屬性的目前有效值。

(繼承來源 DependencyObject)
ReadLocalValue(DependencyProperty)

如果已設定本機值,則傳回相依性屬性的本機值。

(繼承來源 DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

註冊通知函式,以接聽此DependencyObject實例上特定DependencyProperty的變更。

(繼承來源 DependencyObject)
SetValue(DependencyProperty, Object)

設定 DependencyObject上相依性屬性的本機值。

(繼承來源 DependencyObject)
UnregisterPropertyChangedCallback(DependencyProperty, Int64)

取消先前透過呼叫 RegisterPropertyChangedCallback註冊的變更通知。

(繼承來源 DependencyObject)

適用於

另請參閱