Rico Suter's blog.
 

Articles

How to implement and register a custom dependency resolver in ASP.NET MVC 5

The ASP.NET MVC 5 framework supports the integration of 3rd party dependency injection frameworks. This can be done by implementing the IDependencyResolver interface and registering an instance of the interface on application startup. The registration is made in the Application_Start method which can be found in the Global.asax.cs file:
Read More ›

Elegant method parameter validation with Code Contracts support

Each C# developer knows the drill: Each method parameter has to be validated against null values, wrong value ranges or other contract constraints. When also validating using Code Contracts, the resulting code may take up most of the method body:
Read More ›

A transparent undo/redo mechanism for XAML applications

In one of my recent projects, I had to implement an undo/redo mechanism for an observable object graph. The usual approach to this problem is to implement commands which operate on the object graph and provide Do() and Undo() methods. The problem was, that a great portion of the business logic was already implemented and was not command-based. This is why I had to find a solution which works transparently on the property change events of an object graph whose objects implement the INotifyCollectionChanged interface and use the ObservableCollection class for collection properties.
Read More ›

Recommendations and best practices for implementing MVVM and XAML/.NET applications

In this article I’ll describe the rules and practices I’m following for XAML and MVVM application development. I’m using the described techniques since multiple years and they have proven themselves for me. Most of the described rules apply for all types of XAML projects – Windows Store, Windows Phone, Silverlight and WPF projects.
Read More ›

How to mimic singlecast events in C#

C# only supports multicast events and delegates. Even if you define a delegate property without the event keyword, it still remains multicasted:
Read More ›

Implementation of “hybrid” (console or GUI) .NET applicatios

Have you ever had the need to use an application (.exe) as a command line tool when started in the console (cmd.exe) and as GUI application when started from the Explorer shell? This article explains a possible implementation for this requirement.
Read More ›

The correct handling of a WCF client’s life cycle

The most intuitive way of handling a generated WCF client’s life cycle is by putting it into a using block:
Read More ›

How to create an MSI installer using the WiX toolset

This article provides a simple guide about how to quickly create a WiX installer project for an existing WPF application or another Windows desktop application.
Read More ›

Taking fear from the .NET/XAML guy: Implement single-page web applications with TypeScript and MVVM

This article provides a simple guide about how to quickly create a WiX installer project for an existing WPF application or another Windows desktop application.
Read More ›

Merging a Pull Request in Visual Studio

Recently I tried to merge a Pull Request from CodePlex directly in Visual Studio. However, if the Pull Request comes from a forked repository, there is no way around using the command line tools to pull the remote branch into a local branch. It is actually very simple; just perform the following steps.
Read More ›