This article is sponsored by
Telerik RadControls for Silverlight. For similarly awesome content check out
Telerik XAMLflix, your step-by-step guide to Telerik Silverlight and WPF controls. Get access to video tutorials, written tutorials, and tons of code!
Introduction
Today we begin a new and exciting series covering the new features in Silverlight 5. I am going to guide you step-by-step through the process of getting started with Silverlight 5 and then we will dive into the features that are the most important to you.
But first, we are going to :
- Explain why you should read this series over other Silverlight 5 series.
- We will give a very brief introduction to Silverlight.
- Take a look at the Roadmap for this series.
- Review Silverlight’s history.
- Download the bits required to develop a Silverlight 5 application.
- Become familiar with creating a new Silverlight 5 application.
Why read this series over others?
I’m sure you have seen a lot of Silverlight 5 information on the web and are wondering what makes this series different, so I will go ahead and tell you.
- Individual blog posts about Silverlight 5 are scattered all over the internet, it takes time to research and find relevant information. In this series, all information will be grouped together and easily referenced.
- Post-beta, Microsoft changed RichTextBox to RichTextBlock. Many samples on the web are still showing the old version and have never been updated.
- Breaking changes in Silverlight 5 that have happened recently will be included.
- I am a Silverlight MVP / Silverlight Insider and XAML Advocate. I have spent the last few years of my life specializing in Silverlight and sharing the information to others.
A (very) Brief Introduction to Silverlight
Microsoft Silverlight is an application framework for writing Rich Internet Applications. The run-time environment is available as a plug-in for most web browsers and works on a variety of operating systems including Windows, Mac and Linux. While most people know Silverlight for the media capabilities, it has quickly turned into a solution for many Line-of-Business applications. Silverlight 5, which is expected at the end of this year includes many new features that were not included in the previous version.
The Roadmap for this Series
Below you will find the roadmap for this series. I modeled this list closely from Pete Brown’s List of what is new in Silverlight 5 and looked at each new feature of Silverlight 5. I believe most developers will find the following features useful in their day-to-day work than others. If you want a specific topic covered then please leave it in the comments below.
1) Introduction to SL5 [This Post] – This post which provides a brief history of Silverlight and relevant links.
2) Binding - Ancestor Relative Source Binding and Implicit Data Templates.
3) Graphics –XNA 3D API and Improved Graphics Stack.
4) Media - Low-Latency Sound using XNA and Remote Control and Media Command (Keys) Support.
5) Text - Text Tracking and Leading, Linked and Multi-column Text, OpenType Support, Pixel Snapped Text and TextOptions.
6) Operating System Integration Part 1 - P/Invoke, Multiple Windows and Unrestricted File System Access in Full Trust.
7) Operating System Integration Part 2 - Default Filename for SaveFileDialog, 64-bit browser support and Power Awareness.
8) Productivity and Performance - XAML Binding Debugging, Parser Performance Improvements and Multi-core JIT for improved start-up time.
9) Controls - Double and Triple click support, PivotViewer and ComboBox Type-Ahead.
10) Other items - In-Browser HTML, PostScript and Tasks for TPL.
Let’s Begin with the History of Silverlight
Before diving into Silverlight 5, let’s take a brief look at where Silverlight started and where it is now.
Silverlight Version |
*Features/Highlights |
Release Dates |
Silverlight 1 |
- Developed under the codename WPF/E which stands for Windows Presentation Foundation / Everywhere.
- Started by invoking the Silverlight control from the HTML page, which then loads up a XAML File.
- Silverlight exposes a DOM (API), which is limited to JavaScript running in the browser.
- Data formats is limited to XML and JSON.
|
2007 |
Silverlight 2 |
- Included a version of the .NET Framework, implementing the CLR as 3.0.
- Can execute programs written in any .NET language.
- XAML Markup, as well as the code, is compiled into .NET assemblies which are then compressed using ZIP and stored in a .XAP File.
- Included classes for data access over web services, REST, WCF Services and ADO.NET Data Services.
- Several Media features included.
|
2008 |
Silverlight 3 |
- Silverlight has gained a lot of traction against competitors of RIA.
- UI Elements supports element-to-element binding.
- Can save files anywhere on the system via the SaveFileDialog.
- Supports Out-of-Browser Applications.
- Can check for updates on every launch and updates are automatically installed.
|
2009 |
Silverlight 4 |
- Microsoft continues to add features to enhance Silverlight.
- Web cam and microphone support.
- Printing Support
- Clipboard and drag and drop support.
- WCF Rich internet application Services
- Component Object Model Support
|
2010 |
Silverlight 5 |
- Continues as a mature platform for developing LOB Applications. (Many new features added)
- Debug Data-Binding Expressions.
- XNA 3D API & Built-in 3D Graphics Support.
- Many Text Improvements.
- P/Invoke Support.
- In-Browser HTML.
- 64-bit browser Support.
|
2011 (expected) |
*Referenced Wikipedia Silverlight History
As you can see, a new version of Silverlight has been released every year. Every year Silverlight is also becoming more feature rich and expanding upon the previous version. With Silverlight 5, we see that it continues as being a mature platform for developing LOB applications. Now that we have learned a little more about Silverlight, let’s begin by downloading the bits necessary to build a Silverlight 5 application.
Downloading the Bits
Below you will find the download links necessary to build a Silverlight application .
Note: You can install the beta on top of the final release of Silverlight 4.
- Visual Studio 2010 SP1 or Visual Web Developer Express 2010 SP1 is required to develop Silverlight 5 Applications. Visual Studio 2010 SP1 or Visual Web Developer Express 2010 SP1.
- After you have installed VS2010 SP1 or Visual Web Developer Express 2010 SP1 then you will need to download and install the Silverlight 5 Tools for Visual Studio 2010 SP1.
- This download will install all components necessary for Silverlight 5 development:
- Silverlight 5 Developer Runtime
- Silverlight 5 SDK (software development kit)
- Update for Visual Studio 2010 Service Pack 1 and Visual Web Developer Express 2010 Service Pack 1 (KB2502836)
- Microsoft WCF RIA Services V1.0 SP2 RC
- Download the Silverlight 5 Toolkit for additional templates.
- You should also install the Expression Blend Preview for Silverlight 5. The current version of Expression Blend 4 will not allow you to make changes to your Silverlight 5 UI.
- I always like to have a local copy of the help documentation on my hard drive in case I need to read it while on a flight or if my internet is down. So, I would recommend downloading the Silverlight 5 SDK CHM Help documentation. It is around ~75MB, but well worth it in those tight situations.
A couple of optional files are located below. Most of these tools are automatically installed when you installed the Silverlight 5 Tools.
- For reference purposes, the developer runtimes are available here for Windows and Mac OS.
- The WCF RIA Services v1 SP2 RC can be found here but as mentioned earlier it is installed with the Silverlight 5 Tools.
- I found the Silverlight 5 Features list helpful for understanding what is and isn’t included in the release.
- You can also download the Silverlight 5 SDK but it is also installed with the Silverlight 5 Tools.
Note: If you are planning on developing Silverlight LOB Applications and want a jump start on developing then I would also recommend downloading and installing Telerik’s Silverlight Controls. They have a free trial available with absolutely no commitment.
After everything is installed…
Launch Visual Studio 2010 and select File –> New Project. Then select Silverlight –> Silverlight Application –> Give it a name and hit OK.
On the New Silverlight Application Screen, you will see under “Options” that you may select which version of Silverlight that you want to use. Silverlight 5 is selected by default from this screen.
NOTE: You also have the ability to select Silverlight 3 or 4 from this drop-down.
Go ahead and hit “OK”.
Next Steps…
We now have a blank canvas to be working from. Please come back soon as we begin diving into the new binding features in Silverlight 5.
Conclusion
We have briefly discussed what Silverlight is, seen the roadmap for this series, looked at the history of Silverlight, downloaded the required bits and became familiar with a new Silverlight 5 project. In the next part of the series, we are going to take a look at several new binding features such as Ancestor Relative Source Binding and Implicit Data Templates. I would like to take a minute to thank Telerik for sponsoring this series. I would also like to invite you to connect with me on Twitter and check out my blog. Thank you for reading.