A Custom Storyboard Component in Xaml

In WPF & Silverlight, a Storyboard is a collection of animations running in parallel.  Not everyone likes the name “Storyboard” though.  The idea behind the name was that that list of timelines running in parallel are like a list of plot lines in the plan for a movie. In any case, just like you can…

0

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 TreeView to a collection with some hierarchy, which leads me to HierarchicalDataTemplate, which didn’t always just write itself for me.  If you look at it in steps, though, there really is a pretty nice progression from ListBox…

27

A Comparable DataTrigger

Property triggers today only check for equality.  We’d like to add support for other comparison operators, but that hasn’t happened yet.  But I needed them for a project, and wrote a workaround for it.  It’s a bit hacky in a couple of places, but if you can get past that, it’s a handy way to…

7

Trying out Binding.StringFormat

  StringFormat is a new property in .Net 3.5 SP1, which is currently in Beta.  See Scott’s blog for more info on the beta.     When you bind data into a property on an element, it’s automatically type converted for you.  For example, this markup:   <StackPanel xmlns:sys=”clr-namespace:System;assembly=mscorlib”>     <StackPanel.DataContext>         <sys:Int32>123</sys:Int32>     </StackPanel.DataContext>…

7

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 systems and embedded systems; high- and low-level languages; kernel mode, user mode, real mode, and protected mode; system services; domain controllers; bootstrappers; image processors; a debugger; a compiler; a search engine; small systems and really big systems; file systems;…

4

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 objects into your view.  If you’re doing this for an application that will run as an Xbap (“WPF Browser Application”) or as a Silverlight app, just note that you need to generate nominal types rather than anonymous…

5

Where does a Binding find its data?

If you’ve look at much WPF Xaml you’ve probably seen bindings like this:   <TextBlock Text=”{Binding Name” />   … which binds the Text property of the TextBlock to the Name property of some data object.   The question that begets is:  where does the data come from?  The rest of this post looks at…

5