Silverlight 5 Validation

Here is a post on Silverlight validation from Steven Hollidge on #WINNING with C# Silverlight 5 Validation Moving forward with .NET 4.5 the validation story will be played out through the INotifyDataErrorInfo interface. This demo can also be accessed online here. Tricks This example shows the following tricks when validating user input in Silverlight: MVVM with independent … Continue reading Silverlight 5 Validation

Understanding MVVM in 5 Minutes

The Model-View-ViewModel (MVVM) pattern provides a flexible way to build Silverlight applications that promotes code re-use, simplifies maintenance and supports testing. The pattern consists of three different components including the Model (entities and code on the server), the View (the Silverlight screens) and the ViewModel (the glue between the Model and the View). The essential … Continue reading Understanding MVVM in 5 Minutes

How to: Use a Background Worker

In Silverlight, there is a BackgroundWorker class that provides a mechanism to perform time consuming tasks on a background thread. The BackgroundWorker also allows you to report progress back to the UI thread and also cancel the on going operation. Follow theses simple steps to get the BackgroundWorker started. Steps 1. Create an instance of the BackgroundWorker class BackgroundWorker bw = new BackgroundWorker(); Specify whether you want … Continue reading How to: Use a Background Worker

Simplifying Async Networking with Tasks in Silverlight 5

Pete Brown explains how to use the Task Parallel Library available in Silverlight 5 RC for Async Taks. In the example, he uses the TaskFactory.FromAsync Method to create a HTTP Web request and read its response. Simplifying Async Networking with Tasks in Silverlight 5 - Pete Brown's Related Links Task Parallel Library What's New or … Continue reading Simplifying Async Networking with Tasks in Silverlight 5

Isolated Storage in Silverlight

Storing data in the Isolated storage can be useful, however you need to take appropriate precautions. Wrap all calls to isolated storage within try/catch blocks to be resilient to potential IsolatedStorageExceptions, which can be thrown if isolated storage is disabled or if the store has been deleted. If your Silverlight application needs to store a … Continue reading Isolated Storage in Silverlight

Silverlight 5 Incompatibility: Play by the Rules

Have you ever used a resource in the Visual tree of a control just to hold a data object which you can access later in an Item Template. For example: <Grid> <Grid.Resources> <ContentControl x:Key="BindingContent" Content="{Binding}" /> </Grid.Resources> <ListBox> <ListBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding MyProperty}" Foreground="{Binding Path=Content.MyProperty2, Source={StaticResource BindingContent}}" /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </Grid> In this example, … Continue reading Silverlight 5 Incompatibility: Play by the Rules

Understanding dependency properties

Many a times while developing your WPF, Silverlight or even Windows Phone application, you require the need to use a Dependency Property. A dependency property is one of the most complex concept to understand conceptually, let alone implement it. For all those who need to understand more about dependency properties and their usage, check out Dependency … Continue reading Understanding dependency properties