Silverlight FAQ – 13 Questions for Beginners

Posted by: Mahesh Sabnis , on 12/19/2010, in Category Silverlight 2, 3, 4 and 5
Views: 39387
Abstract: This article contains a Silverlight FAQ (Frequently asked questions) to help those who are new to Silverlight or plan to get started with Silverlight.

As a trainer, I conduct lots of trainings on WCF, WPF and Silverlight and most of the times, my participants, especially those coming from an ASP.NET background, ask me some common questions on why and when to use Silverlight. Though there are various web sites which provide information about Silverlight including the official Silverlight site and my articles on DotNetCurry, I still face these queries on a regular basis. I finally thought of writing a General Silverlight FAQ to help those who are new to Silverlight or plan to get started with Silverlight.

Once you have read the FAQ, you can read some Silverlight Articles here to see how to use it in your applications.

Q1. What is Silverlight?
- Silverlight is  a powerful technology used to build rich browser, desktop and mobile user experience (UX) applications with the support for Media, multithreading, data binding, 2-D and 3-D graphics. Powered by the .NET framework, Silveright is a free plug-in and compatible with multiple browsers, devices and operating systems
- It has its own CLR (coreclr.dll) and exists as a browser plug-In (npctrl.dll).
- For Silverlight development, you can either install Silverlight using the
Web Platform Installer or use Silverlight 4 Tools for Visual Studio 2010.
- The latest version is Silverlight 4.0 and a plan has been laid out for Silverlight 5.0

Q2. Is Silverlight a replacement for ASP.NET?
Absolutely not. ASP.NET provides its own power of server side programming, with more enhanced security. Silverlight plugin executes inside the browser sandbox (client side) and needs to be configured explicitly for security using WCF services for authorization and authentication. A mix of ASP.NET and Silverlight is used in most applications.

Q3. Can we develop Client-server applications or Intranet applications using Silverlight?
This totally depends on the architecture and application requirements. One important thing to note here is that Silverlight applications cannot ‘directly’ connect to the database server. So thinking of a client-server application development using Silverlight might require some thinking on your part. WindowsForm or WPF can be a good choice in this scenario.

Q4. What type of applications can be developed using Silverlight?
You can think of developing browser or mobile applications using Silverlight, where you need to represent output in a graphical form, a rich UX. For E.g. In case of a healthcare application, you can think of using Silverlight for simulating ECG of the patient, as shown below:

Silverlight Health Care

The above output makes use of Polyline 2-D graphical element of Silverlight. Likewise various types of Line-of-Business (LOB) applications, for various domains can be developed. Some example are :
- Healthcare.
- Insurance
- Logistic
and any other domains you can think of.

Q5. How then the data be made available to Silverlight applications?
- For developing Line-Of-Business (LOB) applications, Silverlight supports Data-Binding features with OneWay, TwoWay binding mechanism.
- Using Windows Communication Foundation (WCF), data from the remote server can be made available to Silverlight applications.
- The communication between Silverlight and WCF service is possible using ‘basicHttpBinding’. This is the binding provided in WCF service for HTTP protocol with plain text communication from Silverlight to WCF.

Q6. What types of security measures are provided with Silverlight?
- For secure communication, Silverlight makes use of WCF service and uses the security features of WCF.
- You can also make use of Secure Socket Layer (SSL) transport security mechanism from Silverlight to WCF.

Q7. Can the Silverlight application be deployed on the desktop?
- Yes, Absolutely possible. With Silverlight 3.0 version and onwards, the Out-Of-Browser (OOB) facility has been provided. Using this feature, the Silverlight application can be physically deployed on local machine.
- In Silverlight 4.0 the OOB facility has been enhanced with elevated rights, which allows a Silverlight application to do the following:
        -Communicate with Word, Excel type applications by using COM enhancements, provided in Silverlight 4.0. 
         -Communicate with local database e.g. MS-Access, Sql Server etc.

Q8. Where is the Silverlight application present, is it on the Web server or on the Client?
- The Silverlight application in most cases is hosted in an ASP.NET webpage, although it can be hosted on HTML pages too. The extension of the SL plugin is .xap.
- When the end-user makes an HTTP request to this ASP.NET page (.aspx), the Silverlight application is made available to the browser and the result is displayed.

Q9. What are the controls provided in Silverlight for Line-of-Business (LOB) applications?
You can make use of following controls:
- DataGrid.
- DataForm.
- Chart controls etc.

Q10. Can the Silverlight application communicate with ASP.NET?
This can be possible using:
- Cookies.
- QueryString.
- You can use JavaScript on the ASP.NET page and it can be called in Silverlight.

Q11. What is the real advantage of using Excel/Word files or local database in Silverlight?
- This can be required when the end-user is using Silverlight application in OOB (Out-Of-Browser) and for storing and fetching the frequently required data, instead of relying on WCF service for data communication, the data can be fetched and stored in Excel sheet on the local database
- In case of the Excel/Word files communication, they are recommended to be stored in ‘MyDocuments’ special folder.

Check my article Reading Excel File in Silverlight 4.0 - COM Programming to know more.

Q12.What are the advantages of Extensible Application Markup Language (XAML) over C# or VB.NET
- One important thing note here is that C#/VB.NET (code-behind files) have their own important roles to play.
- XAML provides lots of features like code-less development, creating complex UI controls E.g. creating image list by using ListBox and Image control used together.
- The XAML file can define an instance of the class created using C# and VB.NET and all public properties declared in this class can be directly bound in XAML elements.

Q13. Can we use any specific Patterns in Silverlight programming?
- Yes. In Silverlight, Model-View-View-Model (MVVM) can be used for loosely coupled application development where code can be completed isolated from the XAML.
- We can also use Prism in Silverlight which is a set of classes provided for developing next generation loosely coupled, flexible LOB applications.

Check my article Line of Business (LOB) Application using Silverlight 4, WCF 4, EF 4 and Commanding Architecture


This article has been editorially reviewed by Suprotim Agarwal.

Absolutely Awesome Book on C# and .NET

C# and .NET have been around for a very long time, but their constant growth means there’s always more to learn.

We at DotNetCurry are very excited to announce The Absolutely Awesome Book on C# and .NET. This is a 500 pages concise technical eBook available in PDF, ePub (iPad), and Mobi (Kindle).

Organized around concepts, this Book aims to provide a concise, yet solid foundation in C# and .NET, covering C# 6.0, C# 7.0 and .NET Core, with chapters on the latest .NET Core 3.0, .NET Standard and C# 8.0 (final release) too. Use these concepts to deepen your existing knowledge of C# and .NET, to have a solid grasp of the latest in C# and .NET OR to crack your next .NET Interview.

Click here to Explore the Table of Contents or Download Sample Chapters!

What Others Are Reading!
Was this article worth reading? Share it with fellow developers too. Thanks!
Share on LinkedIn
Share on Google+

Mahesh Sabnis is a DotNetCurry author and a Microsoft MVP having over two decades of experience in IT education and development. He is a Microsoft Certified Trainer (MCT) since 2005 and has conducted various Corporate Training programs for .NET Technologies (all versions), and Front-end technologies like Angular and React. Follow him on twitter @maheshdotnet or connect with him on LinkedIn

Page copy protected against web site content infringement 	by Copyscape

Feedback - Leave us some adulation, criticism and everything in between!
Comment posted by Renato on Sunday, December 19, 2010 10:59 PM
Nice faq!
Comment posted by Mahesh Sabnis on Monday, December 20, 2010 12:32 AM
Hi Renato,

Thanks a Lot

Mahesh Sabnis
Comment posted by Karmaloop Coupons on Tuesday, December 28, 2010 3:28 AM
Good questions with good answers. It is helpful.
Comment posted by Mahesh Sabnis on Tuesday, December 28, 2010 11:33 PM
Hi Karmaloop Coupon
Thanks a lot.
Mahesh Sabnis
Comment posted by Karmaloop rep code on Wednesday, December 29, 2010 4:09 AM
Very nice post. I really enjoy the reading. I come here from the google while searching for some good article.Thanks
Comment posted by Mahesh Sabnis on Wednesday, December 29, 2010 11:57 PM
Hi Karmaloop rep code,
  Thanks a lot.
Mahesh Sabnis
Comment posted by aftab on Wednesday, January 12, 2011 1:01 AM
Hello Mahesh sir, Great faq!!!
I wanted to create an application which will turn on the camera at the click of a button on the aspx page. Is this possible using Silverlight ?
Keep posting :)
Comment posted by Ajay Bhingare on Tuesday, February 1, 2011 1:39 AM
As usual your post are always helpful. This post is very good for starters(also level 100/200) to know the basics of SL.I am trying to go with all your post on SL. Thanks , Ajay.
Comment posted by praveen on Friday, November 29, 2013 11:02 PM
This is praveen I have arnd 4 yes of experience in n went to future in silver light thou to get train






jQuery CookBook