Data See, Data Do

Mike Hillberg's Blog on Wpf and Silverlight

A Custom Storyboard Component in Xaml

In WPF & Silverlight, a Storyboard is a collection of animations running in parallel. Not...

Author: Mike Hillberg [Microsoft] Date: 11/20/2009

TreeView and HierarchicalDataTemplate, Step-by-Step

I’ve never found TreeView to be terribly confusing by itself. But usually I want to data bind a...

Author: Mike Hillberg [Microsoft] Date: 10/30/2009

Why is it called a "DependencyProperty"?

When we create new classes and members we spend a lot of time and effort to make them as usable,...

Author: Mike Hillberg [Microsoft] Date: 03/27/2009

Implementing SelectedValue with the Silverlight ComboBox

Here’s the scenario … You have a Customers collection and an Orders collection. In the Orders...

Author: Mike Hillberg [Microsoft] Date: 03/26/2009

An ICommand with IsEnabled

ICommand is a simple interface with three members – Execute, CanExecute, and CanExecuteChanged (more...

Author: Mike Hillberg [Microsoft] Date: 03/24/2009

ICommand is like a chocolate cake

(This has been updated with some information about the origin of a routed command’s route, and of...

Author: Mike Hillberg [Microsoft] Date: 03/20/2009

A master/detail view with navigation

I don’t remember what got me thinking about it, but somewhere along the line I wanted a...

Author: Mike Hillberg [Microsoft] Date: 01/09/2009

A Comparable DataTrigger

Property triggers today only check for equality. We’d like to add support for other comparison...

Author: Mike Hillberg [Microsoft] Date: 09/30/2008

Compact CheckBox Sample

I was creating a view of an object that had a bunch of boolean properties, but I wanted to keep the...

Author: Mike Hillberg [Microsoft] Date: 06/13/2008

Trying out Binding.StringFormat

StringFormat is a new property in .Net 3.5 SP1, which is currently in Beta. See Scott’s blog for...

Author: Mike Hillberg [Microsoft] Date: 05/29/2008

Model-see, Model-do, and the Poo is Optional

Like a lot of people, I’ve developed software professionally for a lot of different environments: PC...

Author: Mike Hillberg [Microsoft] Date: 05/21/2008

Binding to anonymous types in an Xbap or Silverlight application

It's easy to use Linq queries to create objects, and to use {Binding}s to bind properties of those...

Author: Mike Hillberg [Microsoft] Date: 05/05/2008

Simple way to create a gradient brush in Xaml

Rob, Nikhil & I were talking today about the early days of Xaml when you could create linear...

Author: Mike Hillberg [Microsoft] Date: 04/25/2008

A Context-Sensitive Help Provider in Wpf

Here's an example of a way to add context-sensitive help to your application. The main idea is to...

Author: Mike Hillberg [Microsoft] Date: 07/26/2007

A look at stretchy elements

There are several elements in Wpf that have a "Stretch" property. The basic idea of these properties...

Author: Mike Hillberg [Microsoft] Date: 07/05/2007

Building read-only objects in Xaml

We often use Xaml to instantiate and initialize objects. For example, given “<Foo Bar=’1’/>”,...

Author: Mike Hillberg [Microsoft] Date: 07/02/2007

Two ProgressBar Tricks

Here’s a couple of handy ProgressBar tricks … The first trick is to use a negative Minimum value, so...

Author: Mike Hillberg [Microsoft] Date: 05/17/2007

Namespaces in Xaml

If you’re really into Xml conformance, and you’ve really wondered how Xaml uses Xml namespaces, read...

Author: Mike Hillberg [Microsoft] Date: 05/16/2007

Expandos in xaml

This post has a couple of suggestions on ways to accomplish expandos in Xaml. First some background...

Author: Mike Hillberg [Microsoft] Date: 05/14/2007

Where does a Binding find its data?

If you’ve look at much WPF Xaml you’ve probably seen bindings like this: <TextBlock...

Author: Mike Hillberg [Microsoft] Date: 05/14/2007

How to target a template setter at non-element content

Here’s a technique you can follow to use property triggers in a template on non-element type...

Author: Mike Hillberg [Microsoft] Date: 05/07/2007

Tip: Using XamlWriter and XamlReader to clone an object

There are multiple ways to clone objects, and multiple definitions of what “clone” should even mean....

Author: Mike Hillberg [Microsoft] Date: 05/01/2007

Parameterized templates; and how to create reusable, custom-looking buttons without code

I’ve talked to a few people recently about parameterized templates, and so I wanted to write some of...

Author: Mike Hillberg [Microsoft] Date: 02/01/2007

How to control the mouse cursor

How to set the mouse cursor in one easy step: set the Cursor property. For example, this markup:...

Author: Mike Hillberg [Microsoft] Date: 11/22/2006

A TreeView, a HierarchicalDataTemplate, and a 2D collection walk into a bar ...

Bea has a handy post describing how to group items in a collection using a CollectionViewSource. I...

Author: Mike Hillberg [Microsoft] Date: 10/11/2006

Limited generics support in Xaml

In a post to the WPF forum, Zhou Yong had the idea to use a MarkupExtension to make it possible to...

Author: Mike Hillberg [Microsoft] Date: 10/06/2006

Brief anatomy of a ListBox

ListBox has properties on it that allow you to control how the items in the list box get displayed....

Author: Mike Hillberg [Microsoft] Date: 09/29/2006

Xaml Inspired Markup

A lot has been written about how Xaml maps tags and attributes to objects and properties. (Here’s a...

Author: Mike Hillberg [Microsoft] Date: 09/27/2006

Tip: Cannot animate '...' on an immutable object instance

For the most part, you can animate any property in a WPF application. For example, the following is...

Author: Mike Hillberg [Microsoft] Date: 09/25/2006

Tips & Tricks: How to undo an implicit style

You can define a style that gets used by all elements of a type, such as this case (this causes all...

Author: Mike Hillberg [Microsoft] Date: 09/21/2006

A trigger for the TreeViewItem directly under the mouse

In a post to the WPF forum, martinabc wanted to define a TreeViewItem style that would trigger off...

Author: Mike Hillberg [Microsoft] Date: 09/21/2006

Sharing, and not sharing, Setter.Value in a Style or Template

Setter values in a style or template get shared, which is good for performance, but impacts how some...

Author: Mike Hillberg [Microsoft] Date: 09/20/2006

The Loaded event and the Initialized event

In WPF, controls have both a Loaded even and an Initialized event. Initializing and loading a...

Author: Mike Hillberg [Microsoft] Date: 09/19/2006

Being written by XamlWriter

A big part of WPF (Avalon) is the Xaml format for creating object trees. You can also go in the...

Author: Mike Hillberg [Microsoft] Date: 09/16/2006

Trace sources in WPF

WPF (Avalon) uses the .Net tracing system to provide some diagnostics about what’s going on...

Author: Mike Hillberg [Microsoft] Date: 09/14/2006