Hi,
How can i make default page in silverlight.
Thanks, in advance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
avadesh chauhanPosted Sep 1, 2011, 3:35 AM
Each Silverlight project can have multiple .xaml files. However, only one .xaml file will be visible at a time.
When you create a Silverlight project in Visual Studio, it will create a .xaml file called "Page1.xaml" by default and this .xaml control will be displayed by default when you open the web page.
You can change the default .xaml page by setting the property "Application.RootVisual".
To try this, add a .xaml file called "Page2.xaml" in your silverlight project.
Now, open your App.xaml.cs file in the Silverlight project. Look at the Application_Startup event handler. There you can see the default .xaml page being set. To change the default .xaml page, you have to specify the name of the class used in the .xaml page and set it to the Application.RootVisual property as shown below:
After you change the value here, compile the application and run. When the web page is opened, you can see that the new .xaml control is displayed in the web page.