Home Interview Questions and Answers Silverlight Interview Questions and Answers Part-4

silverlight31. How can you change the startup page of SilevrLight application?
Open the App.xaml.cs file

In the Application_Startup event handler, set the RootVisual property to the
instance of the particular SilverlIght class
example: if we have a file known as MainPage.xaml, a class known as MainPage will
be there in MainPage.xaml.cs.

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

32. What is Silver light Run time?
Silver light run time is a plug-in for browsers to support silver-light enabled applications. If silver light run time is not installed, browsers will not be able to run silver light elements in the browser. We can setup the silver light tags such a way that your browser will automatically prompts the user to download and install the silver light plug-in when your application is launched in the browser.

33. Can we add the reference of class library project in silver light application project?
No, we can’t add the reference of class library inside the silver light application project. We can only add the reference of another silver light application project inside the silver light application project.However, we can add the reference of Web Service or WCF Service.

34. What is .xap file?
A .xap file is a silver light based application package that is generated when the silver light project is built.Once we have created the .xap file, the silverlight plug-in downloads the file and runs it in a separate workspace.

35. What is the use of Client Bin folder?
Client Bin folder is used to place the .xap file of silver light application. We can keep this anywhere in our web application but this is the default that is used by silver light.

36. How to change the default page of silver light application?
To change the default page of silver light application, you need to set the Root Visual property inside the Application_Startup event of App.xaml file.
Eg:

private void Application_Startup(object sender, StartupEventArgs e)

{

this.RootVisual = new YourPage();

}

When you create a new project in silver light through Visual Studio, how many xaml files are created and what are the uses of those files?
Two xaml files are created in silver light project. They are (i) App.xaml (ii) MainPage.xaml

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 events (this is almost similar to global.asax file in asp.net application). By default following events are created in the App.xaml.cs

Application_Startup

Application_Exit

Application_UnhandledException

ReportErrorToDOM

2.MainPage.xaml or Page.xaml – This page is the default page of the silver light application and when the silver light application runs this becomes the default page to appear (this page is like the default.aspx page of asp.net application)

37. Can you provide a list of Layout Management Panels and when you will use them?
Canvas Panel: Use the canvas for simple layouts and when there is no need to re-size panel. Controls can overlap each other when resizing the panel.

Stack Panel: Use this for grouping controls in a stack (horizontal/vertical). Controls do not overlap.

Grid Panel: Most flexible, multi rows/columns layouts. Similar to a HTML table.

38. What are the steps will followed when consuming WCF in silver light?
4 simple steps to consume WCF service using Silver light

– Create the WCF service
– Enable Cross Domain for your WCF service
– Add the WCF service reference
– Call the Service

39.What is Isolated Storage?
Silver light uses isolated storage as a virtual file system to store data in a hidden folder on your machine. It breaks up the data into two separate sections:

Section #1 contains the administrative information such as disk quota

Section #2 contains the actual data.

Each silver light application is allocated its own portion of the storage with the current quota set to be 1 MB per application.

Is it possible to create a silverlight application without .NET Framework ?

It is possible to create a silverlight application without using .NET Framework.
This is so because, the silverlight framework version 4.0 includes a compact version of .NET.
So, it works independently.

40. How can be a silverlight application shown in Full-Screen mode ?
You can show the silverlight application in full-screen mode by using the following command:

Application.Current.Host.Content.IsFullScreen = true;

You may also like

Leave a Comment