Tag Archives: XAML

WPF Expander HeaderTemplates – Don’t Forget The Binding!

Every time I customize an Expander in WPF using a HeaderTemplate, I make a critical mistake. I forget to set the binding for the header. Here’s a contrived example to demonstrate the problem – and the solution. Here’s what we’re … Continue reading

Posted in Reference | Tagged , , | 8 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

Custom ScrollBars in WPF

The following post contains a basic example of how to customise the WPF ScrollView scroll bars. The original XAML was built using Expression Blend, and has been further simplified for clarity. The resulting ScrollView looks like this: Firstly, the ScrollViewerControlTemplate … Continue reading

Posted in Reference | Tagged , | 5 Comments

Regular Expression Tester

Download RegexTester.zip (8 KB) Here’s a little tool I put together for building regular expressions. It has built-in patterns for detecting dates, email addresses, XML nodes and URLs. Enjoy. Download RegexTester.zip (8 KB)

Posted in Projects | Tagged , | Leave a comment

WPF Icon Previewer

Download WPFIconPreview.zip (21 KB) I’ve begun using Xaml-based icons in my WPF applications, but I’ve found that I didn’t have any tools to preview them with. There are probably plenty of tools already available, but I couldn’t resist the challenge… … Continue reading

Posted in Projects | Tagged , | 3 Comments

WPF Notepad

Download WPFNotepad.zip (21 KB) When learning a new language it helps to have mini-projects to keep you focused. This is my first mini-project; notepad in WPF. This brings together ideas from my previous two posts into one application. Full source … Continue reading

Posted in Projects | Tagged , | Leave a comment

WPF Commanding

WPF Commanding is a new way to wire-up UI events. This post will demonstrate how this works by using a TextBox and a standard Edit menu. Let’s start with a skeleton application: Here’s the magic, the menu items only require … Continue reading

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