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)

Syntax

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

returnValue = instance.GetImage(type, _
    desiredSize)
public virtual Object GetImage(
    Type type,
    Size desiredSize
)
public:
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 

Parameters

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

Return Value

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

Exceptions

Exception Condition
ArgumentNullException

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

Remarks

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

Reference

NewItemFactory Class

NewItemFactory Members

Microsoft.Windows.Design.PropertyEditing Namespace

Other Resources

WPF Designer Extensibility