Silverlight FAQ from TechDays
Thanks for everyone who came out to the Toronto and Montreal TechDays. The three Silverlight sessions in both cities are extremely popular with long line-up of people wanting to ask questions about after the presentations. Robert Burke (Silverlight Samurai Skills presenter in Toronto), Laurent Duveau (Silverlight Samurai Skills presenter in Montreal), and I (presented Silverlight Control Framework) gathered some frequently asked questions below and provide our answers to share with you.
1. What tools do I need for building Silverlight 2 applications?
From the design side, you need Microsoft Expression Blend 2 and then install Microsoft Expression Blend 2 Service Pack 1. Expression Blend 2 along with Service Pack 1 allows designers to graphically create UI's for Silverlight 2 applications. From the development side, you need Visual Studio 2008 SP1 or Visual Web Developer Express with SP1 and download the Silverlight Tools for Visual Studio 2008 SP1. For creating Deep Zoom experience, Install Deep Zoom Composer. Also, download Silverlight Toolkit. This Toolkit is a Microsoft project containing Silverlight controls, components and utilities that can be downloaded and used in your Silverlight applications. It includes full source code, samples and tests.
2. How does Silverlight deal with multiple paged applications?
Think about SL applications more like desktop applications in the sense that a new page can be created dynamically in runtime. The implementation is quite simple: you create your different pages as page1 (.xaml and .xaml.cs), page2, page3, … , and then create a Page Switcher (i.e. it`s the initial start page) so that it can load different pages as necessary. This way not all pages need to be created at the beginning, and when a new page replaces an old page in the Page, the old page goes to garbage collection. Watch a tutorial on Using Multiple Pages.
3. Do I need special servers to host Silverlight applications?
No. SL applications are complied as .xap file which is essentially a zip file and can be hosted on any server.
4. Expression Training for Designers?
Yes. There are quite a few online tutorials for designers. Please see my Expression Resource blog post.
5. How is Silverlight different than Flash?
Using Silverlight, you can created similar experience as Flash on the web. However, there are several areas of experience we demonstrated at this year`s MIX conference that would be very hard to build with Flash. First is the rich interactive Olympic media experience that was delivered using Silverlight by NBC in August. Flash doesn't have the adaptive streaming capabilities to host that type of experience. Second is the Deep Zoom experience that comes with Silverlight 2, which is very hard to achieve using Flash.
Second, Silverlight is part of our UX platform, which spans from Windows to the Web, and include emerging surfaces such as the media/living room (Xbox360, Media Center PC), as well as mobile devices. Each of these platforms has shared capabilities and development tooling, but greatly different performance and integration characteristics. Similar to developing Windows based desktop application, Silverlight apps can be developed using the same tools - Expression Studio and Visual Studio. Thus, Windows designers and developers can easily transfer their skills to develop Silverlight applications
Third, designers and developers can work together building Silverlight apps more effectively using the integration between Expression and Visual Studio. The "secret sauce" to the process is XAML which provides the ability for both designers and developers to work on assets with the two tools with little to know re-work as the assets are passed back and forth between the two roles. The most interesting thing about Designers for SL is that your vector based graphics and layout are immediately "ready" for use by the dev's and will look exactly the way they were designed in the final product.
6. What about Silverlight and SEO ?
You can use some Search Engine Optimization techniques to expose Silverlight content to search engines. You can read the following links to find out more.
7. Can I use ADO.NET in Silverlight ?
ADO.NET is not available in Silverlight and it makes sense as Silverlight runs in the browser. The way you manage data with Silverlight is by creating a model over your db on the server and expose it with web services. You can look at this ADO.NET Data Services example.
8. Would you recommend Silverlight for line of business application ?
Silverlight has everything you need to do data driven apps: data controls like DataGrid, rich Networking (WCF, SOAP Web Service, REST, ...), LINQ, Data Binding.
The question is more on who your users are (Win, MAC, Linux ?) and where they are (Internet, Intranet ?).
You can read more on this blog post for more information:
9. Is ASP.NET dead ???
10. Can you set/read cookies in Silverlight ?
Silverlight runs in a sandbox and do not have access to local files on the client. To store app settings, user preferences or small pieces of data you can use Isolated Storage: http://silverlight.net/learn/learnvideo.aspx?video=65677
11. Compare Silverlight vs WPF XBAP
XBAP (XAML Browser Application) allows you to run Rich Internet Applications that look and function like WPF desktop applications in browsers (IE and Firefox on Windows). A restriction on XBAP is that it needs .NET framework 3.0 or higher to be installed on the client machine to run.
- Only Targets IE and Firefox on Windows
- All WPF Features/controls are available
- Supports 3D
- Deployment is harder as we need to take care of deploying all .Net Dependencies on client Machines
- Heavy Weight
- Better for Intranet Applciations
- Cross browser, cross platform
- Subset of WPF features
- Easy deployment (xap packages) and light Weight
- Better for Internet Applications
12. Can you store .NET objects in Isolated Storage ?
Yes you can write any .NET object or collection in the local cache and read(cast) them later. However, remember avoid saving sensitive data like passwords or connection strings as user can get access to these files.
13. Is there any reporting control with Silverlight 2 ?
There is no Reporting component in Silverlight but you can use the new charts controls in the Silverlight Toolkit.
Robert Burke's Blog: http://robburke.net/
Laurent Duveau's Blog: http://weblogs.asp.net/lduveau/