共用方式為


PropertyPath 建構函式

定義

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

多載

PropertyPath(Object)

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

PropertyPath(String, Object[])

使用提供的路徑語彙基元 (Token) 字串和參數,初始化 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

描述 Common Language Runtime 路徑的屬性路徑, (CLR) 屬性或單一相依性屬性。

備註

此建構函式有兩個完全不同的使用方式,取決於它是否用於系結的來源模式屬性路徑,或是腳本目標的目標模式單一步驟屬性路徑。

如果在系結的來源模式中使用這個 PropertyPathparameter 則為代表屬性名稱的字串,或者可以是描述物件 CLR 物件模型中屬性之「逐步執行」路徑的字串,該物件是做為系結來源的物件。 對於系結屬性路徑,識別 「step」 的字元是點 (.) 。 也支援索引子參考 (包括多個索引子,以及類型差異) 。 如需 物件特別使用 Binding 之字串語法的詳細資訊,請參閱 Binding.Path 。 做為系結來源的屬性不需要相依性屬性。 如果系結會雙向更新,則參考的屬性必須是讀寫。 另請注意,系結目標必須是相依性屬性。 如需詳細資訊,請參閱 資料系結概觀

如果在腳本目標目標的單一步驟路徑中使用此選項 PropertyPathparameter 通常會以 類型 DependencyProperty 提供。 您也可以指定為 的 Name 字串。 其中一個都會評估為相同的結果,因為它會以字串的形式儲存在內部。 提供的 DependencyProperty 會透過 DependencyPropertyConverter 轉換成字串。 DependencyPropertyConverter支援相依性屬性的限定命名格式,因此您可以指定 typeNamepropertyName 程式碼中建構函式的 propertyName 限定相依性屬性名稱字串 PropertyPath.PropertyPath 。 相依性屬性識別碼的限定路徑與複雜路徑的概念不同。 應改為使用 PropertyPath.PropertyPath 建構函式來建立複雜路徑 PropertyPath

另請參閱

適用於

PropertyPath(String, Object[])

使用提供的路徑語彙基元 (Token) 字串和參數,初始化 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 使用方式。

這個建構函式支援 params 建構函 pathParameters 式引數。 因此,您可以將 的內容 pathParameters 指定為一系列的逗號分隔建構函式引數,以填入陣列,而不需要維度陣列,然後填 pathParameters 入專案。 您指定的每個專案都必須是下列其中一種類型: DependencyProperty 、、 PropertyDescriptor PropertyInfo

如需參數需求的詳細資訊,請參閱 PathPathParameters

適用於