Category Archives: Tips and Tricks

Wiki Markup Hyperlinks for WPF or HTML

This article shows an example of a Wiki-inspired markup for embedding hyperlinks in text – and how to render it as WPF and HTML. When building any kind of content management system, it’s a good idea to give users the … Continue reading

Posted in Tips and Tricks | Tagged , , | Leave a comment

Windows Azure Emulator – Unavailable Ports

I tried launching the Windows Azure Emulator today and hit the follow error: Role instances are taking longer than expected to start. Do you want to continue waiting? It turns out that the emulator has trouble starting if any of … Continue reading

Posted in Tips and Tricks | Tagged , , | Leave a comment

Timing a Method in C#

Here’s a very quick way to check the performance of a block of code. I’m wrapping a System.Diagnostics.Stopwatch class and sending all timings directly to Debug.WriteLine(). Please be aware that this is a very simplistic approach, and does not guarantee … Continue reading

Posted in Tips and Tricks | Tagged , | 2 Comments

Using Shapes as a Resource in WPF

This post covers how to re-use a collection of WPF shapes by combining them into a resource. Start by creating the drawing using Expression Blend. This example using a combination of Ellipses, Rectangles and Paths to create the rounded triangle: … Continue reading

Posted in Tips and Tricks | Tagged , , | 1 Comment

Sending Appointments to a BlackBerry

Sending a calendar appointment over the web is usually straight-forward. Most calendar applications understand the iCalendar format and will automatically import the appointment when an iCalendar file is opened (.ics is the common extension for iCalendar files on the Windows … Continue reading

Posted in Tips and Tricks | Tagged , , | Leave a comment

Keyboard Friendly TextBox

Building keyboard-friendly interfaces can be tricky. For screens with multiple fixed-length TextBoxes, users don’t want to constantly press the tab key to move from one TextBox to the next. In addition, when tabbing between TextBoxes it’s reasonable to assume that … Continue reading

Posted in Tips and Tricks | Tagged , , | 1 Comment

Switch Statement Code Snippet

Another Visual Studio tip – a colleague of mine showed me the “switch” code snippet. It automatically builds a complete switch statement with a case for each value in an enumeration. This can really save some time. Here’s an example: … Continue reading

Posted in Tips and Tricks | Tagged , , | 1 Comment