Saturday, January 23, 2010

New features in Silverlight 4 Beta: C# 4 & Sharing Assemblies with .NET Apps

Have you tried to use new C# 4 features in Silverlight 4 Beta ? Read this post.

I’ve made Silverlight sample (CSharp4) to demonstrate new C# 4 features and new BCL types

  1. Dynamic Binding
  2. Named and Optional Arguments 
  3. Tuples

Silverlight 4 has also changes in Collection Sets and parsing and formatting time intervals.

Covariance and contravariance don’t work in Silverlight 4 Beta (I have tested it – you can’t compile code with variance).

I’ve built second Silverlight example (ModifyHTMLbyNET) to show HTML /JavaScript integration with  dynamic type.

Both samples you can download below.

Dynamic type is very useful for native integration (COM), too.

You can read about sharing Silverlight assemblies with .NET here and here.

Useful links

No comments: