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
- context
Type: Microsoft.Windows.Design.EditingContext
The designer's editing context.
- 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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
CreateStaticMemberItem Overload
Microsoft.Windows.Design.Model Namespace