語言

PropertyPath 建構函式

定義

初始化 PropertyPath 類別的新執行個體。

多載

名稱 Description
PropertyPath(Object)

初始化 PropertyPath 類別的新執行個體。

PropertyPath(String, Object[])

初始化該類別的新實例 PropertyPath ,使用提供的路徑標記字串與參數。

PropertyPath(Object)

初始化 PropertyPath 類別的新執行個體。

public:
 PropertyPath(System::Object ^ parameter);
public PropertyPath(object parameter);
new System.Windows.PropertyPath : obj -> System.Windows.PropertyPath
Public Sub New (parameter As Object)

參數

parameter
Object

屬性路徑描述指向共同語言執行時(CLR)屬性的路徑,或單一相依屬性。

備註

這個建構器有兩種完全不同的用法,分別是用於綁定的來源模式屬性路徑,或是用於故事板目標的目標模式單步屬性路徑。

若以原始碼模式使用綁 PropertyPath 定 parameter ,則是代表屬性名稱的字串,或是描述物件 CLR 物件模型中作為綁定來源物件的「步進」路徑的字串。 對於綁定性質路徑,識別「步驟」的字元是一個點(.)。 同時也支援索引器參考(包括多個索引器及型別差異化)。 關於物件特定使用的 Binding 字串語法,請參見 Binding.Path。 用作綁定來源的屬性不一定是依賴性質。 若綁定是雙向更新,則所引用的屬性必須是讀寫。 另外要注意,綁定目標必須是相依屬性。 如需詳細資訊,請參閱 資料系結概觀。

若以目標模式使用此 PropertyPath 方法作為分鏡目標的單步路徑, parameter 通常會提供型別 DependencyProperty。 你也可以指定一個字串, Name使得 。 這兩者的計算結果相同,因為它是以字串形式儲存在內部。 A 被 轉換為 DependencyProperty 透過 DependencyPropertyConverter的字串。 它DependencyPropertyConverter支援一個限定的相依屬性命名格式,所以你可以指定類型名稱。在程式碼中,將 propertyName 限定的相依屬性名稱字串傳入PropertyPath.PropertyPath建構子。 相依屬性識別碼的合格路徑與複雜路徑是不同的概念。 應該用建構子建立PropertyPath一個複數路徑PropertyPath.PropertyPath。

另請參閱

適用於

PropertyPath(String, Object[])

初始化該類別的新實例 PropertyPath ,使用提供的路徑標記字串與參數。

public:
 PropertyPath(System::String ^ path, ... cli::array <System::Object ^> ^ pathParameters);
public PropertyPath(string path, params object[] pathParameters);
new System.Windows.PropertyPath : string * obj[] -> System.Windows.PropertyPath
Public Sub New (path As String, ParamArray pathParameters As Object())

參數

path
String

一個以標記化格式指定 的 Path字串。

pathParameters
Object[]

一個物件陣列,用來設定 PathParameters。

備註

此簽名通常僅用於具有複雜路徑的目標模式 PropertyPath 使用。

此構造子支持paramspathParameters建構子論證。 因此你可以將 的內容pathParameters指定為一連串逗號分隔的建構子參數來填充陣列,而不必先給陣列維度調整,再用項目填充。pathParameters 你指定的每個項目必須是以下類型之一:DependencyProperty, , PropertyInfoPropertyDescriptor,

關於參數要求的更多資訊,請參見 Path 和 PathParameters。

適用於