Tag Archives: client

Tip: New .NET 4 String Function to Check for Empty Strings

How many times have you written code similar to this? string firstName = FirstName.Text.Trim(); if (!string.IsNullOrEmpty(firstName)) { // do something } or if (someParam == null || string.IsNullOrEmpty(someParam.Trim()) throw new ArgumentException(”Empty string”, “someParam”); // do something A nice little time-saver for those guard functions is now included in .NET 4: the IsNullOrWhiteSpace function: if (!string.IsNullOrWhiteSpace(FirstName.Text)) { // do something } IsNullOrWhiteSpace checks for null, empty or whitespace characters. Sure, it’s a little thing, but it’s nice to have it in there, especially considering we get all sorts of nice new little things, and the client framework install is still smaller than it was in .NET 3.5

See the original post:
Tip: New .NET 4 String Function to Check for Empty Strings

Getting Started with WPF : Hello World in multiple flavors

So you’re brand spanking new to WPF . You have to start somewhere, so how about good old “Hello World”. Tooling First, some tooling. If you are in a situation where you can use Beta or RC products, download Microsoft Visual Studio 2010 RC.

Continued here: 
Getting Started with WPF : Hello World in multiple flavors

Using RIA Services Programmatically

Many demos of WCF RIA Services show off using the DomainDataSource Class to in a declarative manner to quickly throw together a data-enabled application. And in VS2010, there is added support for using the Data Sources Window to Drag/Drop data entities onto the designer — this action also adds a DomainDataSource instance into your XAML. For many applications, using a DomainDataSource in XAML is fine and enables RAD development. But some pundits (Hi Shawn!) argue that having direct interaction with the Data Layer from the UI Layer is bad for proper Model/View separation, testability, and general karma. Luckily, there are several ways to use WCF RIA Services programmatically - without relying on the DomainDataSource controls in XAML. Let’s take a look at some of these programmatic methods: Download the Demo Code   * requires SL4/VS2010 Beta 2 , WCF RIA Services Beta Using the DomainContext The DomainContext class allows the Silverlight client to access the Domain Service Class you created on the server side. A new DomainContext class is automatically generated on the client side for you when you create a new Domain Service. In the demo , our DomainContext class is named BeerContext

Excerpt from:
Using RIA Services Programmatically

Silverlight Application – Animal Testing Breaks Hearts

PETA and AIS just completed a great Silverlight 2 application for the Animal Testing Breaks Hearts campaign. Almost exactly two years ago, in time for the 7/7/7 Live Earth event, AIS created the first Silverlight managed code application ever to go live. It was a carbon offset calculator written for Conservation International using Silverlight 1.1alpha. AIS’s RIA practice, Silverlight itself, and the tools like Blend, have all grown since then. Two years later, and we’re again working with a non-profit on a socially conscious application. This time, the cause is animal testing rather than environmental conservation, and the technology is the final version of Silverlight 2 rather than an early alpha preview of the technology For this application, PETA supplied all the comps in Adobe Illustrator format and AIS converted the assets into Silverlight. Tad Van Fleet took the heart images and others and imported them into Blend 3 using the new Illustrator import function, and created the appropriate Xaml

See the original post:
Silverlight Application – Animal Testing Breaks Hearts

Silverlight and WPF: The XAML Continuum - Mike Taulty

I saw that Karl had been busy on the plane and had written this post around sharing code between WPF and Silverlight and so I wanted to flag that up here.

Continued here:
Silverlight and WPF: The XAML Continuum - Mike Taulty

.NET RIA Services: Get your metadata from anywhere!

While the feedback on .NET RIA Services has been great, many people have commented on the way we store metadata as custom attributes on “buddy” classes of entities.