Gets or sets user-defined initialization parameters.
<object ...> <param name="initparams" value="initParamsString"/> ... </object>
Silverlight.CreateObject(,,,,,"initParamsString"); -or- Silverlight.CreateObjectEx({initparams:"initParamsString"});s
value = silverlightObject.InitParams;
IXcpControl::InitParams
See StartupEventArgs..::.InitParams.
A string that represents a set of user-defined initialization parameters. The format of the value can be user-defined. The default value is null or an empty string.
The InitParams property is write-once during instantiation and read-only at run time. It cannot be set after initialization. The InitParams initialization parameter specifies user-defined parameter values when you create an instance of the Silverlight plug-in in an HTML page. InitParams provides a convenient way to pass custom string values from the HTML Document Object Model (DOM) to the Silverlight programming model.
Generally, if you have more than one string value to pass, you use a comma as a delimiter in the InitParams string. In the JavaScript API, using the general string functions for JavaScript, you can parse and split the string into separate parameters. If you use managed code, the StartupEventArgs..::.InitParams object in which the property value is passed expects a particular format for the input string.
The InitParams values are provided as event data for the Startup event, and also as the InitParams property of SilverlightHost. The property is useful if you did not handle Startup, however you should make sure you are accessing the property at a point in application lifetime when the parameters are available (which is after Startup). In either the event data or the property, the original InitParams string is redefined as a dictionary. To be processed correctly into a dictionary, your string must have key-value pairs with an equals sign between key and value. For more than one key-value pair, use commas as delimiters between key=value pairs. For details, see StartupEventArgs..::.InitParams.