Friday, August 29, 2008

Daily Links 29/08/2008

Fast Serialization
"This solution is for a fairly niche condition and is heavily optimized"

URL rewriting in ASP.NET web applications

NHibernate 2.0 released

Silverlight Contrib
"The aim of this project is to offer the most comprehensive collection of free and open source Silverlight
controls"
something to keep an eye on :)

Creating Vista Style Login Screen With Silverlight 2 Beta 2

Making reflection fly and exploring delegates

Occasionally Connected Client Support With VS 2008 SP1

Free .NET 3.5 training
"for experienced Developers and Software Architects who are looking to adopt Microsoft's next generation technology"

Root Cause of Singletons
...with some interesting comments for and against singletons.

Portable Apps for your thumb-drive
web browser, email client, audio player, encryption, office suite - VERY handy :)

XamlPadX 4.0
update to a cool xaml editor

Monday, August 25, 2008

Daily Links 25/08/2008

Silverlight: Binding and Threading == Cat and Dog
"when a binding notification is raised from a separate thread than the Dispatcher thread, an exception is thrown" - article for a work-around to this problem

Auto-sizing the Silverlight DataGrid

Silverlight Particle Generator
posted just for the coolness (and that it was done is silverlight :) )
- with source code

CoolMenu: A Silverlight Menu Control
- with source code

Calling WCF on the server of origin from Silverlight
Handy for making the service valid for development and deployment environments

Base Classes for User Controls
I still prefer to make the UserControl a Resource build action and paste the generated code in the main class as a temparary measure - at least you get designer support, which is missing in the above work-around.

SkyFire
The windows mobile browser that supports silverlight :)

Share files online with box.net

Sunday, August 24, 2008

Host Silverlight in Blogger

Been meaning to test the Silverlight Streaming Silverlight host site in blogger for a while now - so I slapped together a Media Element with the silverlight logo as content (if you click on it, it will take you to the silverlight.net home page.)
Testing 1 2 3...



Well, it seems to be working :)
Now I just have to find the best solution for sharing / hosting files in blogger.

Friday, August 22, 2008

Daily Links - Best of: Silverlight 2

I've been posting the daily links series just on a year now, so I thought it a good time to summarize some of the best links in a "Best of" series. Because I'm busy working on a Silverlight RIA application, I thought it an obvious first candidate.

Silverlight Install

Silverlight Home Page
Here you'll find just about all you need to know about developing with Silverlight, including videos and tutorials, as well as blogs and forums.

Silverlight Show
Stay up to date with the latest silverlight news.

Silverlight, Blend and WPF Tutorials

Silverlight Cream

Silverlight links post

50 new silverlight screencasts

Silverlight Testing

Continuous Integration and Testing silverlight applications with WatiN
Wrap microsoft's silverlight test framework using the silverlight nunit framework and WatiN to enable CI
Mocking and IOC in Silverlight 2, Castle Project and Moq ports
temp solution for those of us doing TDD for silverlight BETA. Hopefully a permanent solution will follow shortly.
UI Automation of a Silverlight Custom Control
Silverlight NUnit Projects
I was half way through doing the same thing when I came across this post. saved me some work :)
TestDriven .NET now has support for Silverlight 2.0 Beta 1
Only ad-hoc tests supported thus far though
Unit Testing with Silverlight - the FULL article

Silverlight Controls

Silverlight 2 messagebox example
Free WPF and Sivlerlight components
DevExpress has released Beta 1 of it's FREE Silverlight DataGrid
More free Silverlight Charting
Free Silverlight Controls from VectorLight

Silverlight Services Communication

Pushing data to a silverlight client with sockets
as apposed to using WCF duplex services which is basically a wrapper for a polling mechanism.
Pushing Data to a Silverlight Client with a WCF Duplex Service
Silverlight 2 Beta 2 basic ClientAccessPolicy.xml file
CRUD operations in Silverlight using ADO.NET Data Services

Silverlight Graphics

In-State Animation with Silverlight
One of the best things about silverlight is how it makes control animation so easy, even non-designers can use it :)
Build custom skins for your silverlight UI
Theme Controls in Silverlight

Silverlight Misc

Silverlight Desktop
"A framework that allows you to dynamically load Silverlight modules into resizable draggable windows."
ViewModel Pattern in Silverlight using Behaviors

Thursday, August 21, 2008

Daily Links 21/08/2008

Visual Thesaurus - Mindware
Expand your vocab for your writing

Continuous Integration and Testing silverlight applications with WatiN
Wrap microsoft's silverlight test framework using the silverlight nunit framework and WatiN to enable CI

WPF Datagrid & the WPF Toolkit
Great resource for WPF controls

Silverlight 2 Samples: Dragging, docking, expanding panels (Part 2)

Silverlight 2 messagebox example

Silverlight blog
mostly to do with the graphical side of silverlight

Pushing data to a silverlight client with sockets
as apposed to using WCF duplex services which is basically a wrapper for a polling mechanism.

Scrum - A Not-so-bad Development Methodology
Some positive experiences using the scrum software development methodology

Testing a singleton
One of the main gripes against singletons by the TDD zealots is that they're aren't very testable. These articles offer some work-arounds to enable singleton testing.

Tuesday, August 19, 2008

Generic SetValue Method for INotifyPropertyChanged

I needed a generic SetValue method for my objects that implemented INotifyPropertyChanged, since all my setters looked like:

image

... and I wanted something like:

image

... and here's the end result: (applied to a base object which all other INotifyPropertyChanged objects inherit from)

image

It shortened my 650 line code file to 325 lines :)

for copy and paste:

protected void SetValue<T>(ref T valueToSet, T newValue, string propertyName)

        {

            if (valueToSet == null || !valueToSet.Equals(newValue))

            {

                if (!(valueToSet == null && newValue == null))

                {

                    valueToSet = newValue;

                    RaisePropertyChanged(propertyName);

                }

            }

        }

Notes:

  • The ref parameter was necessary (as apposed to returning T), because TwoWay binding to the object will not work in Silverlight (and I assume WPF) if the actual property is changed after the PropertyChanged event is fired.
  • All that null checking is necessary to take into account ref / value types. The null check in the first if statement ensures that the valueToSet.Equals does not throw a NullReferenceException, and the null checks in the second if statement ensures that if the original value is null, that the new value is something other than null (ie: has changed)

Extending SetValue Method with VerifyProperty Method

I came across this great post for implementing a base BindableObject, which does a little more than I'd like, but one cool idea is to add a VerifyProperty method, so while developing, you can catch any spelling mistakes in the propertyName parameter.
It uses reflection to ensure that the property indeed does exist on the object, and makes use if conditional compilation so the code is not deployed to the release build - like so:

image

follow the link for a demo project. (rename the extension to .zip)

... so the modified SetValue method would look like:

protected void SetValue<T>(ref T valueToSet, T newValue, string propertyName)

        {

            if (valueToSet == null || !valueToSet.Equals(newValue))

            {

                if (!(valueToSet == null && newValue == null))

                {

                    VerifyProperty(propertyName);

                    valueToSet = newValue;

                    RaisePropertyChanged(propertyName);

                }

            }

        }

    
   

Monday, August 18, 2008

Daily Links 18/08/2008

Log4PostSharp - logging with AOP
Add logging to your application using AOP (ie: don't bloat your code with log statements - AOP does it all in the background by hooking into the method calls)

Moq
"take full advantage of .NET 3.5 (i.e. Linq expression trees) and C# 3.0 features (i.e. lambda expressions) that make it the most productive, type-safe and refactoring-friendly mocking library available. And it supports mocking interfaces as well as classes. Its API is extremely simple and straightforward, and doesn't require any prior knowledge or experience with mocking concepts. "
Interesting...think I'm going to check it out :)

Mocking and IOC in Silverlight 2, Castle Project and Moq ports
temp solution for those of us doing TDD for silverlight BETA. Hopefully a permanent solution will follow shortly.

Silverlight 2 Tools, SQL Server 2008 and Visual Studio 2008 SP1 Installed & Working Together

WPF splash screen template for VS

What’s new in WPF 3.5 SP1: Splash Screen to improve perceived startup performance

Free WPF and Sivlerlight components

Free (Lite Version) Icon Editor Addin for Visual Studio 2008

A Common Base Class for LINQ to SQL

Burn Your Burn-down Charts
using Burn-Up charts to depict project focus as scope changes

Thursday, August 7, 2008

Daily Links 07/08/2008

The Request/Response Service Layer
Maintain the granularity of your WCF services, whilst allowing multiple requests in a single call - follow-up to the previous "batching WCF services" posts.

Silverlight Streaming
Host up to 10 Gig of silverlight for free!
More details here

Effects and Transitions for Silverlight

Real-Time Multilingual WPF Demo
Multi-language support using Google's AJAX translation API

Introduction to IoC/DI - The art of Decoupling

Agile Project Planning

I've been looking at LINQ lately to implement data access on the DAL. One of my requirements to to be able to specify queries at runtime. Here are some articles which I've found quite informative

Build your own electric car