NewItemFactory.GetImage Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets an image for the specified Type that can be used as an icon in the collection editor or sub-property editor.

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


Public Overridable Function GetImage ( _
    type As Type, _
    desiredSize As Size _
) As Object
Dim instance As NewItemFactory
Dim type As Type
Dim desiredSize As Size
Dim returnValue As Object

returnValue = instance.GetImage(type, _
public virtual Object GetImage(
    Type type,
    Size desiredSize
virtual Object^ GetImage(
    Type^ type, 
    Size desiredSize
public function GetImage(
    type : Type, 
    desiredSize : Size
) : Object
abstract GetImage : 
        type:Type * 
        desiredSize:Size -> Object 
override GetImage : 
        type:Type * 
        desiredSize:Size -> Object 


  • type
    Type: System.Type
    The type for which to get an image.

Return Value

Type: System.Object
The image to display for type.


Exception Condition

type is nulla null reference (Nothing in Visual Basic).


This method searches for embedded resources in the same assembly as the control.

If multiple images are available for type, this method retrieves the image that is closest to desiredSize. This method is not guaranteed to return an image that matches desiredSize exactly.

The object returned by this method can be set as the Content property of a ContentControl.

The default implementation of this method searches for images that are named Namespace.ControlName.Icon.Extension.

Currently, only the following extensions are recognized:

  • .png

  • .bmp

  • .gif

  • .jpg

  • .jpeg

.NET Framework Security

See Also


NewItemFactory Class

NewItemFactory Members

Microsoft.Windows.Design.PropertyEditing Namespace

Other Resources

WPF Designer Extensibility