views:

16

answers:

1

I have a Silverlight app with two XAML Pages - MainPage and OtherPage How can I add a reference to a page to open the Silverlight control to the specific page?

I have this

    <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
      <param name="source" value="ClientBin/Test.xap"/>
      <param name="onError" value="onSilverlightError" />
      <param name="background" value="white" />
      <param name="minRuntimeVersion" value="3.0.40818.0" />
      <param name="autoUpgrade" value="true" />
      <a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=3.0.40818.0" style="text-decoration:none">
          <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
      </a>
    </object>

Is there a way to do something like this:

      <param name="source" value="ClientBin/Test.xap#OtherPage"/>

How is this done in Silverlight? I'm just guessing here based off the old .NET control embed method http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=187

+1  A: 

You can set the RootVisual property in the Application object:

public partial class App : Application
{
    ...

    private void Application_Startup(object sender, StartupEventArgs e)
    {
        this.RootVisual = new OtherPage();
    }
}
Anero