Silverlight Interview Questions and Answers (65) - Page 4

Can we add the reference of a Class library project in Silverlight application project

No , You can't add the reference of a Class library inside the Silverlight application project. You can only add the reference of another Silverlight application project inside a Silverlight application project.

However, you can add the reference of a Web Service or WCF services.
What is Silverlight.js file

Silverlight.js is a helper file which enables Web sites to create advanced Silverlight installation and instantiation experiences.
What is the use of ClientBin folder

ClientBin folder is used to place the .xap file of Silverlight application. You can keep this anywhere in your web application but this is the default that is used by the Silverlight.
parent xaml tag of Silverlight page?

UserControl is the parent xaml tag of the Silverlight page. All other tags are placed under UserControl tag.

<UserControl x:Class="SilverlightApplication2.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300">
<Grid x:Name="LayoutRoot" Background="White">
</Grid>
</UserControl>


When you create a new project in Silverlight through Visual Studio, how many xaml files are created and what are the uses of those files?

When we create a Silverlight application from Visual Studio, two (2) xaml files are created into the Silverlight project.

They are:
1. App.xaml - App.xaml is a file used to declare shared resources like brushes, various style objects etc. and to handle the global application level event (this is almost similar to global.asax file in asp.net application). By default following events are created in the App.xaml.cs file.

Application_Startup
Application_Exit
Application_UnhandledException
ReportErrorToDOM

2. MainPage.xaml or Page.xaml - This page is the default page of the Silverlight application and when the silverlight application runs this becomes the default page to appear (this page is like the default.aspx page of asp.net application)
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories