次の方法で共有


ModelFactory.CreateStaticMemberItem メソッド

更新 : 2007 年 11 月

指定したクラスの静的メンバの値を表す新しいモデル アイテムを作成します。

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

構文

'宣言
Public Shared Function CreateStaticMemberItem ( _
    context As EditingContext, _
    type As Type, _
    memberName As String _
) As ModelItem
'使用
Dim context As EditingContext
Dim type As Type
Dim memberName As String
Dim returnValue As ModelItem

returnValue = ModelFactory.CreateStaticMemberItem(context, _
    type, memberName)
public static ModelItem CreateStaticMemberItem(
    EditingContext context,
    Type type,
    string memberName
)
public:
static ModelItem^ CreateStaticMemberItem(
    EditingContext^ context, 
    Type^ type, 
    String^ memberName
)
public static function CreateStaticMemberItem(
    context : EditingContext, 
    type : Type, 
    memberName : String
) : ModelItem

パラメータ

  • type
    型 : System.Type

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

  • memberName
    型 : System.String

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

戻り値

型 : Microsoft.Windows.Design.Model.ModelItem

type によって指定される型の memberName によって指定される静的メンバの値を表す ModelItem

解説

たとえば、Brushes.Red への参照をモデルに追加するには、typeof(Brushes) および文字列 "Red" を指定してこのメソッドを呼び出します。これは、{x:Static Brushes.Red} として XAML にシリアル化されます。

アクセス許可

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

参照

参照

ModelFactory クラス

ModelFactory メンバ

Microsoft.Windows.Design.Model 名前空間

その他の技術情報

WPF デザイナの機能拡張