Invokes a method on the current scriptable object, and optionally passes in one or more method parameters.
Assembly: System.Windows.Browser (in System.Windows.Browser.dll)
'Declaration Public Overridable Function Invoke ( _ name As String, _ ParamArray args As Object() _ ) As Object
- Type: System.String
The method to invoke.
- Type: System.Object()
Parameters to be passed to the method.
Return ValueType: System.Object
name is Nothing.
name is an empty string.
name contains an embedded null character (\0).
The method does not exist or is not scriptable.
The underlying method invocation results in an error. The .NET Framework attempts to return the error text that is associated with the error.
If args is Nothing, it is interpreted as an empty parameter list. As a result, passing Nothing is the same as passing new object.
The actual type of the return value is always a string, a primitive type, or a ScriptObject reference. If the underlying value of the requested property is a managed type (other than a derivation of ScriptObject), you can use the ManagedObject property to get the underlying managed type reference.
// Fetch the sixth item in a collection. Invoke("item",5); // Fetch address item from dictionary. Invoke("item","address");
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.