Rico Suter's blog.
 

Articles

How to compare two methods in Visual Studio

Sometimes I need to compare two methods, for example to check if they can be refactored into one. To avoid the time consuming step of copying the two methods into separate files and compare them, I recommend using the Visual Studio extension ClipboardDiff.
Read More ›

Write detailed C# XML documentation and still keep the source code clean

For my open-source project MyToolkit I write a lot of documentation. Currently the documentation for a class has to be updated in two locations: The source code and the project’s wiki. I asked myself how to avoid this and document everything in the source code file – while keeping the source code simple by not putting too much documentation in it.
Read More ›

Use JSON files with schema for application configuration

Often, we face the problem that our customers need highly configurable applications but there is no time to develop rich configuration GUIs. This article describes a possible solution which is a compromise between editing raw configuration files and implementing rich configuration GUIs.
Read More ›

Use XBMC and other non-certified PlayTo receivers in Windows 8

PlayTo is a great technology which provides the ability to play the current video or music from your tablet to your TV. The problem is, that most devices, for example a HTPC running XBMC, supports PlayTo but is not certified. However there is a way to simply disable this restriction and use non-certified devices as PlayTo receivers. The reason why this is not enabled by default is that these devices may not work properly.
Read More ›

Develop an app which targets WP7 and WP8 (and WinRT) at the same time

This post shows how to develop an app which targets the WP7 and WP8 platform at the same time. The idea is to create two projects – one for WP7 and one for WP8 – and link all files into one of the projects. This way you don’t have to maintain the code twice and only have to develop in one project. On Microsofts website you can find the base idea. However this article shows even more problems and their solutions when using this approach. Here are the steps to setup the solution:
Read More ›

EF & WCF: Serialize not loaded collection navigation properties as null rather than an empty collection

Sometimes a web service client wants to know if a collection navigation property (a navigation property with “many” references) of a received entity object has been loaded on the server (e.g. by using Entity Framework’s Include method). By default, not loaded collection navigation properties are serialized as empty collections (not null). This is why the client cannot differentiate between a not loaded property and an empty collection. In one of my projects, I needed to have this information to know if a property is already loaded or has to be lazy loaded using an additional web service call.
Read More ›

Sketchagram diagram editor for Windows 8 released

The first version of Sketchagram has been released to the Windows 8 App Store.
Read More ›

WinRT: Access string resources in a stongly typed way (C#)

In WinRT/C# projects the .resx resource file is not available anymore. The new resource type is .resw which is directly supported by the XAML framework. The drawback of this new file format is that it does not automatically generate a code-behind C# class with a property for each key-value resource pair. The problem is that it is not possible to access these strings in a strongly typed manner. The only way to load resource strings is to load them by specifying the resource key as a string. The problem with this solution is that typing errors are not detected by the compiler but on application runtime.
Read More ›

WinRT: Navigate to the previous page by pressing the back key

If you are developing Metro applications, it is evident to not only have a good tablet experience but also a a good desktop (mouse and keyboard) experience. This is why I implemented a simple solution to navigate to the previous page if the user presses the back key. A lot of standard applications in Windows 8 support this feature already and I hope a lot of new applications will support it as well.
Read More ›

Using Entity Framework Code-First proxies with WCF web services

This blog post demonstrates how to set up a WCF web service together with lazy loading Entity Framework entities. The entities will be developed using a code first approach and their metadata is defined using the fluent API. To use all these features you need to install the newest Entity Framework (version 4.3.1 as of now) as a NuGet package (search for “Entity Framework“).
Read More ›