次の方法で共有


ModelService.CreateStaticMemberItem メソッド

更新 : 2007 年 11 月

派生クラスでオーバーライドされた場合は、指定のクラスの静的メンバの値を表す新しいモデル アイテムを作成します。

名前空間 :  Microsoft.Windows.Design.Services
アセンブリ :  Microsoft.Windows.Design.Interaction (Microsoft.Windows.Design.Interaction.dll 内)

構文

'宣言
Protected MustOverride Function CreateStaticMemberItem ( _
    type As Type, _
    memberName As String _
) As ModelItem
'使用
Dim type As Type
Dim memberName As String
Dim returnValue As ModelItem

returnValue = Me.CreateStaticMemberItem(type, _
    memberName)
protected abstract ModelItem CreateStaticMemberItem(
    Type type,
    string memberName
)
protected:
virtual ModelItem^ CreateStaticMemberItem(
    Type^ type, 
    String^ memberName
) abstract
protected abstract function CreateStaticMemberItem(
    type : Type, 
    memberName : String
) : ModelItem

パラメータ

  • type
    型 : System.Type

    参照されている静的メンバを格納している型。

  • memberName
    型 : System.String

    参照されている静的メンバの名前。

戻り値

型 : Microsoft.Windows.Design.Model.ModelItem

type の静的メンバを表す新規作成モデル アイテム。

解説

CreateStaticMemberItem メソッドは、type の静的メンバの値を表す新しいモデル アイテムを作成します。たとえば、Brushes.Red への参照をモデルに追加するには、typeof(Brushes) および文字列 "Red" を指定してこのメソッドを呼び出します。このアイテムは、以下の XAML にシリアル化されます。

[xaml]

{x:Static Brushes.Red}

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

ModelService クラス

ModelService メンバ

Microsoft.Windows.Design.Services 名前空間

ModelItem

ViewService

DesignerView

ContextItemManager

その他の技術情報

編集モデルのアーキテクチャ

WPF デザイナの機能拡張