开发者

Startup params for Silverlight 4 app

开发者 https://www.devze.com 2022-12-28 04:02 出处:网络
We are moving our SL3 app to SL4.First step was to open it in VS2010; it converted w/o problem.开发者_如何学Go

We are moving our SL3 app to SL4. First step was to open it in VS2010; it converted w/o problem.开发者_如何学Go

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);
        }


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 :)


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

0

精彩评论

暂无评论...
验证码 换一张
取 消