In March of this year SP1 of WCF RIA Services was released together with SP1 of Visual Studio 2010. Soon this was followed by a new version of the WCF RIA Services Toolkit. Microsoft has changed a few things in SP1 which makes it possible for you to implement you own code generation classes that can manipulate the client code generation of RIA Services entities, contexts, … In my opinion this is a great new feature which is very powerful when you are building your own Silverlight framework. So in this article I will describe how the code generation in RIA services SP1 works and I will demonstrate some scenarios and ideas were customizing the generated code is a nice technique to extend your own framework.
- WCF RIA Services code generation
- Setup of demo application
- Installation of Toolkit
- T4 Code generation classes
- Adding interfaces to the generated entities
- Adding attributes to the generated entities
- Using derived data annotation attributes
- Adding XML comments to the generated entities
- Using derived classes for entities, domain contexts and the web context
- Implementing your own logic in the derived classes
A few weeks ago Visual Studio 2010 & .NET 4.0 (CLR, BCL, WPF, WCF, EF, …) release candidates have been released. Last week during the MIX ’10 conference Silverlight 4 & WCF RIA Services v1 RC have been set online. Also a first community preview of Silverlight for Windows Phone 7 has been released. So it’s time to roundup all download locations and links to useful articles, blog posts, videos, samples, …
Visual Studio 2010
- Downloads: Microsoft Portal with download links for all Visual Studio editions (Professional, Premium & Ultimate), Team Foundation Server, SDK, Azure, …
- Article: Team Foundation Server 2010 Key Concepts
- Article: Team Foundation Server 2010: What’s new (Jakob Ehn)
- Article: What’s new for Database projects in VS 2010
- Article: What’s new in Code Analysis for Visual Studio 2010
- Blog: Into Visual Studio Team System (Pieter Gheysens)
- Blog: Visual Studio 2010 Profiler
- Article: What’s new in the Base Class Libraries in .NET 4.0 RC
- Article: What’s new in the Base Class Libraries in .NET 4.0 beta (Justin Van Patten)
- Article: Parallelism in .NET 4.0 (Reed Copsey)
Entity Framework 4.0
- Article: What’s new in WPF 4.0 (Scott Guthrie)
- Article: What’s new in WPF 4.0 beta 2 (Jaime Rodriguez)
- Article: What’s new in WCF 4.0 (Santosh Benjamin)
- Download: Windows Identity Foundation SDK
- Downloads: Silverlight 4.0, Blend 4.0 beta, WCF RIA Services
- Article: What’s new in Silverlight 4.0
- Article: What has changed in the Silverlight 4.0 RC (Tim Heuer)
- Blog: Silverlight 4.0 features (Mike Taulty)
- Article: WCF RIA Services road to RTW via RC (Dinesh Kulkarni)
- Videos: Silverlight 4 training courses
- Blog: WCF RIA Services (Brad Abrams)
Windows Phone Tools
Visual Studio 2010, .NET 4.0 and Silverlight 4 offer a lot of new features. I like all the new features but I was especially interested in improvements that could help my current developments which are based on a M-V-VM architecture with ViewModels and a lot of bindings with UI controls. So I wrote an article and published it on my personal website. The article will focus on the improved design-time features. Along the way I will show a lot of screenshots and try to cover some other new Silverlight 4 features.
- Domain entities and WCF RIA Services
- Base classes and ViewModel interface and implementation
- ViewModel interface
- ViewModelBase class
- DelegateCommand class
- ProductViewModel class
- XAML designer
- Design-time properties
- DesignWidth and DesignHeight
- DataContext and DesignInstance
- Properties window and databinding
- Button and Command
- Showing data in Design-time
- Design-time ViewModel
- Other Silverlight 4 DataBinding improvements
- String indexers
- Dependency Objects
- StringFormat & TextTrimming
- Data Sources window
Yesterday Microsoft released some new preview and beta versions of Silverlight, RIA Services, Blend, Media Framework, Toolkit, … It looks like a major update with a lot of new features (webcam support, RichText control, HTML content, access to local files, drag and drop, ICommand, right clicks and mouse wheel support, …) and improvements (data binding, validation, DataGrid, clipboard, styles, unit testing, …) In this post I will refer to the most interesting posts:
- Tim Heuer gives a great overview with some videos of all new features in Silverlight 4 beta.
- Fore more detailed information and examples about Silverlight 4 you should take a look at Mike Taulty’s posts.
- Also Alex Golesh started posting a lot of detailed examples.
- On Channel9 you can find several hands-on-labs from John Papa that demonstrate all new Silverlight 4 features.
- Nick Kramer posted a Word document with an overview of the new security features in Silverlight 4.
- Jeff Wilcox posted a large walkthrough to demonstrate how to use the Silverlight unit testing tools.
- In the RIA Services forum you will find more information about the new preview of WCF RIA Services. Don’t forget to read the “Breaking changes” document.
- And Brad Abrams describes the new features in WCF RIA Services CTP that are based on feedback of us developers and he also posted a nice step-by-step guide of his demo at PDC 2009.
- Gill Cleeren succeeded in creating a blogpost about Silverlight 4 for each day of the month December.
Silverlight and RIA Services are great technologies and the Model-View-ViewModel (M-V-VM) pattern is a nice approach to keep UI and logic separated. But using the combination of view models with item controls, dataforms and commands can be a laborious task because the databinding features in Silverlight are quite limited. I posted an article on my website in which I demonstrate how binding with ViewModels can be improved by using the BindingHelper class and by creating your own command behaviors.
Last week Microsoft released the official version of Silverlight 3, a new CTP (July 2009) of RIA Services and a RC of Expression Blend 3.0. SL3 is a major update and it is released 9 months after version 2.0, which is quite fast. SL3 provides out of the browser support, HD media support, better graphics, improved data binding, search engine optimization (SEO) support, … It seems that SL3 RTW disables the designer in Visual Studio 2008 because people were having a lot of problems with it. Fortunately the future version 2010 will provide a fully interactive WYSIWYG designer including data binding support within the designer.
Following links can be used to download all the needed setups. Make sure to uninstall the previous versions first.
- Microsoft Silverlight 3 runtime, tools & SDK for Visual Studio 2008 SP1
- Microsoft Silverlight 3 offline documentation (CHM)
- Microsoft Expression Blend 3 + SketchFlow RC (trial)
- Silverlight Toolkit July 2009
- Microsoft .NET RIA Services July 2009 CTP
It seems that these releases contain a lot of breaking changes. I’m already struggling 2 days to migrate a project that has been developed with Silverlight 3 beta and RIA Services CTP May. In SL3 the DataForm has been redesigned and there are changes in the AutoCompleteBox and DataGrid controls. In RIA Services a lot of things have been improved but also changed drastically; code sharing, loading data, authentication, custom validation, update parameters, …
Following blog posts and articles will help you to migrate:
A few months ago Microsoft released the first preview of .NET RIA Services. This new framework promises to simplify building n-tier Line of Business (LoB) applications by providing patterns, components and tools to build services, query data, handle CRUD operations, resolve concurrency, manage data validation, … The March 2009 and the new May 2009 CTP’s only support Silverlight 3 but the final version will also offer support for ASP.NET/MVC/AJAX and WPF.
I have been exploring RIA services for a few weeks now and I must admit that I’m really excited. The architectural design looks quite good, these first CTP’s work fine and it really boosts productivity. The RIA Services framework handles all the plumbing to move entities from the server to the client, it offers advanced change-tracking and caching, several techniques for data validation are provided, there is support for authentication and roles, the integration with Silverlight UI controls like DataForm and DataPager works great and the current support for the ADO.NET Entity Framework really simplifies certain tasks.
If you want to start exploring RIA Services then you should definitely start reading the PDF document that Microsoft has published. This document gives a very good overview of all features of RIA Services.
While using RIA Services I found several great features that I wanted to blog about. In the coming months I will try to write a series of articles about RIA Services. I will not explain the details about its design, but I will try to give a lot of code samples, tips and ideas. I also stumbled upon some limitations and shortcomings of the current preview. So in this first article I will focus on the current limitations and I will offer you some of my workarounds and tips.
- Multiple server side projects
- Multiple client side projects
- ReSharper and Intellisense
- Metadata files
- Metadata attributes
- Operation parameters
- Validation exceptions
- Loading one entity
- Server side problems
- Client side problems
- Assocations and Entity Framework entities
- May CTP changes