Академический Документы
Профессиональный Документы
Культура Документы
Agenda:
Plugin Sizing
Using the InitParams attribute of the object tag that hosts the XAP file
The first method is straight forward: just add a querystring to the URL. You can retrieve the querystring using the
HtmlPage.Document as below:
private void Application_Startup(object sender, StartupEventArgs e)
{ Page p = new Page();
this.RootVisual = p;
StackPanel layoutRoot = p.LayoutRoot;
foreach (String key in HtmlPage.Document.QueryString.Keys)
{
layoutRoot.Children.Add(new TextBlock()
The second method consists of adding a value for the InitParams attribute of the object tag that hosts the XAP file.
The input format of this parameter is a single string with individual parameters delimited using a comma (,), and
keys delimited from values using an equal sign (=). For example:
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%"height="100%">
<param name="source" value="ClientBin/Pochet.SL.xap" />
<object
id="silverlightControl"
data="data:application/x-silverlight-2,"
type="application/x-silverlight-2"
width="100%" height="100%">
<param name="source" value="ClientBin/SilverlighttoJavascript.xap"/>
<param name="onError" value="onSilverlightError" />
Plugin Sizing