October 2010 Blog Posts

RIA Services T4: Walk-Up Experience

UPDATE: The RIA Services team released a December 2010 Toolkit, and that release fixes the build issues encountered below.  But this post still has value as it shows some ways to modify the code generated by our T4 Code Generator.  Be sure to check out Varun Puranik’s Blog for more details on the December 2010 update. The RIA Services T4 Code Generation feature was checked in about 3 hours before we published our MSI for today’s release.  Talk about publishing an experimental feature!  So tonight, I decided to take the app that I’ve been working on for...

posted @ Thursday, October 28, 2010 2:44 AM | Feedback (19)

WCF RIA Services V1.0 SP1 Beta

BAM! This is an exciting day; today we are releasing WCF RIA Services V1.0 SP1 Beta and WCF RIA Services Toolkit October 2010.  These download links are also available from http://silverlight.net/riaservices. Side-by-side installation with WCF RIA Services V1.0 is not supported.  If you already have RIA Services installed on your machine, you should: Uninstall WCF RIA Services Toolkit Uninstall WCF RIA Services V1.0 for Visual Studio 2010 Install WCF RIA Services V1.0 SP1 Beta Install WCF RIA Services Toolkit October 2010 ...

posted @ Wednesday, October 27, 2010 8:26 PM | Feedback (40)

RIA Services Validation: Using ValidationContext (Cross-Entity Validation)

In our last post, we learned how ValidationContext can be used to provide and consume state and services for validation methods to use.  Now, let’s take a quick look at how validation methods can actually use this information.  I’m going to include a bunch of code in this post, and I will rely on the code to be rather self-explanatory. Property-Level Validation In this property-level validation example, we need to validate that the location entered for a meeting is a valid location from our database.  We want this to work both on the server and on the client,...

posted @ Monday, October 25, 2010 1:56 AM | Feedback (20)

RIA Services Validation: Providing ValidationContext

Throughout this series on RIA Services Validation, I’ve mentioned and shown ValidationContext several times.  In this post, we’ll learn about the purpose of ValidationContext, what types of context it can provide, and how it integrates with RIA Services.  This will allow us to explore further topics such as cross-entity validation and open the door for other advanced validation scenarios. ValidationContext Purpose Although ValidationContext exists within the System.ComponentModel.DataAnnotations assembly in both .NET 4.0+ and Silverlight 3+, the class was introduced by the RIA Services team.  While designing the RIA Services validation system, we considered scenarios where validation logic is...

posted @ Monday, October 25, 2010 12:49 AM | Feedback (7)

Privacy Breach Coincidence

I use disposable email addresses pretty aggressively.  When I need to give someone (specifically websites) an email address, I create an address specific to that site.  This has allowed me to easily block those sites that send me spam (or sell my data).  I am very disciplined about this and it has kept a lot of spam away from my eyes. The few times I’ve had my data sold, I report this as a privacy policy violation to the site.  Tonight, I reported such a violation to SnowCovered.com (lack of link intentional). After I sent that...

posted @ Thursday, October 14, 2010 1:09 AM | Feedback (7)

RIA Services Validation: Entity-Level Validation

In my last post, I went over some cross-field validation scenarios and provided some sample code, including a CompareValidatorAttribute.  We’ve now covered single-field validation and cross-field validation, but there’s yet another level of validation supported by RIA Services—Entity-Level validation.  As you’ll see in this post, entity-level validation is very similar to what we’ve already seen. Entity-Level Validation Declaration Your entity types can declare entity-level validation using either the [CustomValidation] attribute approach where a custom validation method is supplied, or by having an attribute that derives from ValidationAttribute.  Either way, to indicate that a validation rule applies at the...

posted @ Tuesday, October 12, 2010 1:31 AM | Feedback (7)

RIA Services Validation: Cross-Field Validation

I frequently hear questions about how to perform cross-field validation in RIA Services.  Before thoroughly covering this topic*, I wanted to be sure to go through some simple scenarios, show how to use CustomValidationAttribute, how to derive from ValidationAttribute, explain how validation rules are propagated to the client, and what triggers the validation.  Hopefully by now, you’re getting pretty comfortable with the validation framework and you’re ready to explore some more examples. * Perhaps you noticed that I snuck a reusable cross-field validator into the Custom Reusable Validators post—it’s a rather useful ConditionallyRequiredAttribute. In this post, I’m going...

posted @ Sunday, October 10, 2010 1:29 AM | Feedback (4)

Old Navy Marketing Idea–Encouraging Weight Loss

This is way off topic for my blog; it has nothing to do with technology.  Feel free to turn around and go home now.  But if you have ever hesitated to buy new clothes because you were planning to lose weight, you might want to stick around.  I just submitted this to Old Navy. I hope they read it and consider the marketing idea. Dear Old Navy, If possible, please route this letter to your marketing department. I have been an Old Navy customer for more than a decade; I've always been impressed with the quality of...

posted @ Saturday, October 9, 2010 10:22 PM | Feedback (2)

RIA Services Validation: Validation Triggers

My goal with this blog post series is to provide an end-to-end tour of how RIA Services validation works and how you can leverage its capabilities to build rich, responsive applications.  A key factor for making the most of validation is fully understanding when and how RIA Services invokes your validation rules.  Awareness of the various validation triggers will help you implement your validators so they are fired as you expect, when you expect.  In this post will dig into the RIA Services codebase and identify every place where entity validation is invoked. Client-Side Validation Property Setters –...

posted @ Wednesday, October 6, 2010 3:48 AM | Feedback (2)