Share via


ModelFactory.CreateStaticMemberItem Method (EditingContext, Type, String)

Creates a new model item that represents the value of a static member of the specified class.

Namespace:  Microsoft.Windows.Design.Model
Assembly:  Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)

Syntax

'Declaration
Public Shared Function CreateStaticMemberItem ( _
    context As EditingContext, _
    type As Type, _
    memberName As String _
) As ModelItem
public static ModelItem CreateStaticMemberItem(
    EditingContext context,
    Type type,
    string memberName
)
public:
static ModelItem^ CreateStaticMemberItem(
    EditingContext^ context, 
    Type^ type, 
    String^ memberName
)
static member CreateStaticMemberItem : 
        context:EditingContext * 
        type:Type * 
        memberName:string -> ModelItem 
public static function CreateStaticMemberItem(
    context : EditingContext, 
    type : Type, 
    memberName : String
) : ModelItem

Parameters

  • type
    Type: System.Type
    The type that contains the static member being referenced.
  • memberName
    Type: System.String
    The name of the static member being referenced.

Return Value

Type: Microsoft.Windows.Design.Model.ModelItem
A ModelItem that represents the value of the static member specified by memberName on the type specified by type.

Exceptions

Exception Condition
ArgumentNullException

context, type, or memberName is null.

Remarks

For example, to add a reference to Brushes.Red to the model, call this method with typeof(Brushes) and the string "Red". This will be serialized into XAML as {x:Static Brushes.Red}.

.NET Framework Security

See Also

Reference

ModelFactory Class

CreateStaticMemberItem Overload

Microsoft.Windows.Design.Model Namespace

Other Resources

WPF Designer Extensibility

Editing Model Architecture