Data-binding Radio Buttons in Silverlight to Enum

In Silverlight there is no Enum.Getvalue() method, so there is not out-of-the box way of databinding a radio buttongroup to an enumerable value in a viewmodel. Step forward converters. using System;using System.Windows.Data;namespace YourNamespace{ public class EnumBoolConverter : IValueConverter{ #region Methods public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture){ if (value == null ||... Continue Reading →

Silverlight 3, Validation, MVVM, WCF and EF

All the current articles and tutorials on Silverlight 3 Validation show really simplistic examples, business objects in the UI space, no services etc etc My Problem When the business objects are being created and managed via the entity framework, there does not appear to be any simple ways of adding the validation properties to the... Continue Reading →

Silverlight unit testing requirements

When setting up a Silverlight Unit Testing class the following using statements and inheritance must be applied: These are required for the TestPanel and EnqueueX methods (particularly inheritance). For more on the Inner Class Pattern, take a look at the Type Mock training blog.

Asynchronous Lambda Method calls

You won’t get any benefit using this code, but it makes for more manageable source. So from Pete Browns blog: All network calls in Silverlight are asynchronous. The proliferation of event handling functions this can cause just makes for really cluttered code. Using lambda expressions seems to make my code a bit cleaner. (You can... Continue Reading →

Persisted Properties

Back in classic ASP.NET I’d persist data extract from a web service in base class property as follows: private string m_stringData; public string _stringData { get { if (m_stringData==null) { //fetch data from my web service m_stringData = ws.FetchData() } return m_stringData; } } This way I could always simple use _stringData and know that... Continue Reading →

A WordPress.com Website.

Up ↑