共用方式為


AdornerResources.CreateResourceKey 方法

為指定的類型和成員名稱建立資源索引鍵。

命名空間:  Microsoft.Windows.Design.Interaction
組件:  Microsoft.Windows.Design.Interaction (在 Microsoft.Windows.Design.Interaction.dll 中)

語法

'宣告
Public Shared Function CreateResourceKey ( _
    owningType As Type, _
    publicMember As String _
) As ResourceKey
public static ResourceKey CreateResourceKey(
    Type owningType,
    string publicMember
)
public:
static ResourceKey^ CreateResourceKey(
    Type^ owningType, 
    String^ publicMember
)
static member CreateResourceKey : 
        owningType:Type * 
        publicMember:string -> ResourceKey 
public static function CreateResourceKey(
    owningType : Type, 
    publicMember : String
) : ResourceKey

參數

  • owningType
    型別:System.Type
    擁有這個資源的類型。
  • publicMember
    型別:System.String
    公開 (Expose) 此資源之公用靜態成員的名稱。

傳回值

型別:System.Windows.ResourceKey
新的資源索引鍵。

例外狀況

例外狀況 條件
ArgumentNullException

owningType 或 publicMember 是 nullNull 參照 (即 Visual Basic 中的 Nothing)。

備註

建立資源索引鍵之後,請呼叫 RegisterResources 方法來註冊可以依該索引鍵提供資源的資源回呼 (Callback)。

.NET Framework 安全性

請參閱

參考

AdornerResources 類別

Microsoft.Windows.Design.Interaction 命名空間

其他資源

WPF 設計工具擴充性

裝飾項架構

建立自訂裝飾項