Silverlight Interview Questions and Answers for Freshers
Online Interview Questions
Explore the best Job Interview Questions and Answers along with the MCQs & Quizzes.
Silverlight is a powerful development tool by Microsoft for creating rich interactive applications for the web and mobile. For freshers aspiring to start their career in Silverlight development, it’s crucial to prepare well for interviews. Here are the top Silverlight interview questions and answers that can help you ace your interview.
Q1. What is Silverlight?
Ans: Silverlight is an open-source development tool by Microsoft used for creating and deploying interactive user experiences, media, and internet applications for web and mobile platforms. It supports rich media and enhances web applications’ interactivity.
Q2. What are the main features of Silverlight?
Ans: Silverlight offers various features, including:
Q3. How does Silverlight differ from Flash?
Ans: While both Silverlight and Flash are used for creating rich internet applications, Silverlight is based on .NET framework and supports languages like C# and VB.NET, whereas Flash uses ActionScript. Silverlight also provides better integration with Microsoft technologies like ASP.NET and SharePoint.
Q4. What is a .XAP file in Silverlight?
Ans: A .XAP file is a compressed output file generated when a Silverlight project is built. It contains the application’s compiled code, resources, and assemblies, making it easy to deploy and run Silverlight applications.
Q5. How do you change the startup page in a Silverlight application?
Ans: To change the startup page, open the App.xaml.cs file and set the RootVisual property in the Application_Startup handler to the desired Silverlight class. For example:
csharp
private void Application_Startup(object sender, StartupEventArgs)
{
this.RootVisual = new MainPage();
}
Q6. What are the main components of a Silverlight application?
Ans: The main components include:
Q7. Explain the difference between Silverlight 1.0 and Silverlight 2.
Ans: Silverlight 1.0 requires all code to be written in JavaScript and XAML, whereas Silverlight 2 allows code to be written in .NET languages. Additionally, Silverlight 2 uses .XAP packages to reference embedded objects and resources.
领英推荐
Q8. What is Moonlight?
Ans: Moonlight is an open-source implementation of Silverlight, developed in collaboration between Microsoft and Novell. It is primarily used on Linux and Unix-like operating systems to run Silverlight applications and provide an SDK for building such applications.
Q9. What are the layout controls available in Silverlight?
Ans: Silverlight provides several layout controls, including:
Q10. What is the Silverlight SDK?
Ans: The Silverlight SDK is a set of tools, documentation, tests, and templates for web designers and developers to create Silverlight-enabled applications more effectively and efficiently.
Q11. How can you enable cross-domain access for a Silverlight application?
Ans: To enable cross-domain access, you need to create a clientaccesspolicy.xml or crossdomain.xml file at the root of the domain that you want to access, specifying the allowed domains and permissions.
Q12. How do you handle errors in Silverlight applications?
Ans: Errors in Silverlight applications can be handled using try-catch blocks, global error handling in App.xaml.cs, and by using the Application_UnhandledException event to catch unhandled exceptions.
Q13. What is the role of App.xaml in Silverlight?
Ans: App.xaml is used to declare shared resources such as styles and brushes, and to handle global application events like Application_Startup, Application_Exit, and Application_UnhandledException.
Q14. Explain the use of the Canvas control in Silverlight.
Ans: The Canvas control allows you to position child elements using explicit x and y coordinates. It’s useful for precise control over the layout of elements.
Q15. What is the significance of the Silverlight plug-in?
Ans: The Silverlight plug-in is essential for running Silverlight applications in browsers. If the plug-in is not installed, browsers cannot run Silverlight elements. The plug-in can prompt users to install it if necessary.
Q16. What is the difference between Silverlight and WPF?
Ans: Silverlight is a subset of WPF designed for web applications, while WPF is used for developing rich graphical desktop applications. Silverlight supports a subset of the features available in WPF and is optimized for cross-browser compatibility.
Summary
Preparing for these questions can help you build a strong foundation and boost your confidence for your Silverlight interviews. Read more: Online Interview Questions