views:

198

answers:

2

Hello -- We are moving our SL3 app to SL4. First step was to open it in VS2010; it converted w/o problem.
However, parameters specified for the start page are not passed along.
That is, if we specify

ourStartPage.aspx?Slam=Dunk&Glass=Sun

in app.xaml.cs, Application_Startup(), e.InitParams is empty.

How do we fix this? Thanks for any advice....
(Note that the very same startup string worked in VS2008.)

UPDATE:
Urrk. This works, but it doesn't seem right:

        // Get settings passed in from the page
        if (e.InitParams.Count > 0 )
        {
            ApplicationStartupContext.Instance.Fill(e.InitParams);
        }
        else
        {
            ApplicationStartupContext.Instance.Fill(HtmlPage.Document.QueryString);
        }
A: 

It looks like it should be supported: http://msdn.microsoft.com/en-us/library/system.windows.startupeventargs.initparams(VS.95).aspx

from that page:

Silverlight

Supported in: 4, 3

Chad
It appears the InitParams collection isn't getting populated correctly (populated at all).
Number8
+2  A: 

The reason it works is that you have your params in the QueryString and not as InitParams as you might think.

InitParams covers a tag in the Silverlight object in HTML

Actually this link is a better example how to :)

cyberzed