Archive for December, 2009

WPF & xaml guidelines

Wpf and xaml has been out for a while now, so the community already knows the do’s and don’ts of programming in xaml. Thankfully, there are always some nice people who share this stuff with us. This is a good resource and starting point. It also includes links to the channel 9 videos that give [...]

Grid Size Sharing WPF

The other day, I had to show different datatemplates depending on a specific property value. (The datatemplateSelector is your friend!) I used different foreground colors to visualize the states; however, the layout design was the same for each datatemplate. I was using a Grid, and wanted to share the columnWidth’s and RowHeight’s. My first solution [...]

Check some (runtime) characteristics of a dependency property

It’s pretty easy to inherit from an existing control in WPF. For instance, this great programmer I know has written an extended combobox. It has extra functionality, like: * Automatically select the value if only one item is available in the items source; * Disable the control when no items are in the items source; [...]

When not implementing the ConvertBack method…

I really like WPF converters. I often don’t need the ConvertBack method though. Most programmers deal with this by leaving the NotImplementedException; or they return null. I also see this method being marked with the [Obsolete()]  attribute. I think this totally gives you the wrong impression that it should not be used anymore. The attribute [...]

WPF vs Silverlight

Last week, I was giving a Silverlight training in the beautiful Bergen (Norway). I have WPF experience, but I was still struggling with some demo’s because of its differences with Silverlight. Silverlight is supposed to be a subset of WPF but that’s not the case (yet). Silverlight even has functionalities that are not in WPF [...]