HtmlWindow.CreateInstance Method

Silverlight

Creates an instance of the specified JavaScript type.

Namespace:  System.Windows.Browser
Assembly:  System.Windows.Browser (in System.Windows.Browser.dll)

public ScriptObject CreateInstance(
	string typeName,
	params Object[] args
)

Parameters

typeName
Type: System.String
An HTML tag name.
args
Type: System.Object[]
Creation parameters.

Return Value

Type: System.Windows.Browser.ScriptObject
A JavaScript type.

ExceptionCondition
ArgumentNullException

typeName is null.

ArgumentException

typeName is an empty string or cannot be resolved.

-or-

There is a type mismatch between one of the supplied creation parameters and the target parameter(s).

The input parameters follow the rules for passing managed types to JavaScript.

The constructed instance is returned by using the heuristics described in Passing JavaScript Objects to Managed Code.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: