This content is based on Beta release, expect many changes in the final release. Check out other Silverlight 5 articles here. What's New - XAML Changes Silverlight 5The first thing to know about Silverlight 5 is that it’s currently in beta, means that it definitely has bugs, and it also not yet feature-complete; some features are going to be shipped later in the final version. In addition, being in beta means that no go-live license available, this is for internal use and testing only so do not install on user’s machine. Worth mentioning that Silverlight 5 was first announced at PDC 2010 conference (October 2010) and the beta version was shipped later at MIX11 (April 2011,) and the final version will be released soon this year. GoalGoals of the version 5 include: - Improving performance
- Getting closer to WPF
- Enabling line-of-business scenarios
- Better development experience
ImprovementsSilverlight 5 has come with lots of improvements and changes, and those improvements can be divided into several areas: - XAML Changes
- Control and Text Improvements
- Graphics and Media Changes
- Elevated-Trust Changes
- Performance and Other Improvements
Getting StartedTo get started you need to have first Microsoft Visual Studio 2010 Service Pack 1 installed on you PC. After that, you can go to http://silverlight.net and download the beta SDK and tools for VS2010. In addition, you can install Microsoft Expression Blend Preview for Silverlight 5 Beta if you like using it. After you have VS2010 SP1 and Silverlight 5 SDK installed on your PC, you can continue reading and start making your cool stuff! Now let’s start with XAML changes, but first let’s take a look at our model that’s going to be used through all the samples. ModelOur demos are based on a very simple model consists of just a collection of paper books and audio books. We have the following business model: public class Book
{
public string Title { get; set; }
public string Author { get; set; }
public decimal Price { get; set; }
}
public class PaperBook : Book
{
public string Isbn { get; set; }
public int Pages { get; set; }
}
public class AudioBook : Book
{
public TimeSpan Duration { get; set; }
}And here’s our collection: public class BookData : List
{
public List PaperBooks
{
get
{
return (from b in this where b is PaperBook
select (PaperBook)b).ToList();
}
}
public List AudioBooks
{
get
{
return (from b in this where b is AudioBook
select (AudioBook)b).ToList();
}
}
public BookData()
{
this.Add(new PaperBook()
{
Title = "The Sixth Man",
Author = "David Baldacci",
Isbn = "9780446573108",
Pages = 432,
Price = 14.28m,
});
...
this.Add(new AudioBook()
{
Title = "Water for Elephants",
Author = "Sara Gruen",
Duration = new TimeSpan(11, 29, 00),
Price = 21.56m,
});
}
} What’s next?Start with… - XAML Changes
- Control and Text Improvements
- Graphics and Media Changes
- Elevated-Trust Changes
- Performance and Other Improvements
|