ScriptObject.ManagedObject Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets the underlying managed object reference of the ScriptObject.

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

Syntax

'Declaration
Public ReadOnly Property ManagedObject As Object
public Object ManagedObject { get; }

Property Value

Type: System.Object
A managed object reference if the current ScriptObject wraps a managed type; otherwise, nulla null reference (Nothing in Visual Basic).

Remarks

This property returns a non-null value when you pass strings and complex managed objects to JavaScript and then back to managed code. Primitive types come back into managed code as primitive types, and structures come back as JavaScript objects. (Therefore, these are ordinary ScriptObject instances.)

Built-in HTML Bridge types are automatically recognized by the Invoke, InvokeSelf, and ScriptObject.GetProperty methods and can be cast to the appropriate type. As a result, ManagedObject returns nulla null reference (Nothing in Visual Basic) for those types.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

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