Silverlight Interview Questions and Answers (65) - Page 2

What is App.xaml?

it is a file used in WPF/SilverLight applications.

Its settings affect the different .xaml pages.

It is used for these reasons

1) Provides a startup URI in WPF or specify the startup page in SilverLight applications

2)Define event handlers like Application_Error, Application_Startup wherever needed.

3)Define global styles inside the resources tag

4)Define properties that can then be used for data passing between .xaml pages.
What is the use of the ClientBin folder?

This folder is used in the ASP.NET application that will be using the Silverlight functionality. This folder contains the .xap file that contains the references of the SilverLight Libraries which will then be used in the ASP.NET application.

Location of the ClleintBin Folder
:It is below the root folder of the Web Application that is attached with the
SilveLight application

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();
What is Silverlight?

Silverlight is a web application framework that provides functionalities similar to those in Adobe Flash, integrating multimedia, graphics, animations and interactivity into single run time environment. It’s a cross-browser, cross-platform implementation of the .NET framework.
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.
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.
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.
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.
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.
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 application). By default following events are created in the App.xaml.cs





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 application)
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.
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
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.
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;
How can be the default page settings changed for a silverlight page ?

You can change the default page settings of a silverlight page.
This can be done by setting the RootVisual property in the Application_Startup event of the App.xaml file.
This is done as follows:

Private void Application_StartUp(object sender, StartupEventArgs e)

this.RootVisual = new MainPage();

Give the reasons how Ajax is better than a Java applet ?

As we know that, the applications with Ajax runs faster when compared to Java applet.
This is because, Java applets load big sized libraries.
But in Ajax, code resides on the web server where, only the required event in the user interface is posted back to the server.
Give an example of creating button in XAML ?

In XAML, a button can be created as in the following example:


<Grid x:Name="LayoutRoot" Background="White">

<Button Width="60" Height="30">Click Here</Button>

But in Visual Studio, you can directly create a button.
Which types of video files can silverlight support ?

Silverlight can support many types of video files.
This platform can support MP3, Windows Media Audio format (wma, wmv7-9), and also VC-1 formats.
Explain Deep Zoom in silverlight ?

Deep Zoom is one of the features of silverlight.
This Deep Zoom function is to zoom in and zoom out the application.
The main advantage of this zooming is that, it will not affect the performance of the 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