Category Archives: Advanced Tutorial

Monkeys in the Cloud

If you filled a room with monkeys and typewriters, would the monkeys eventually create a meaningful work of art? Could they write Shakespeare? Several scholars have pondered this very question, and found that the mathematics of the situation are quite grim. Indeed, monkeys typing random keys could very well write Romeo and Juliet but the…

...  Read More

How To Build a Storyboard Animation for Silverlight in C#

One of the things that I’ve gotten somewhat frustrated in my Silverlight and WPF work is the fact that sometimes (not often, but sometimes), I really need to build a storyboard or keyframe animation programmatically. Especially if you’re doing anything relating to information visualization and you need to create animations for path points, it can…

...  Read More

How To Animate a Changing Property in a Custom Control in Silverlight

For my recent visualization, I created a custom control in Silverlight that animated the color of a Path every time a “Fill” property on the control was changed. I thought I would pass along my learning from this process. First thing I learned was that you cannot use TemplateBinding in a Storyboard (I think). I…

...  Read More

How To Create a PART in Your Silverlight Custom Control

There are about a dozen videos and tutorials on how to create a custom control in Silverlight 3. (Here’s my favorite, from Karen Corby. Skip to about 47 minutes for the tutorial part.) But sometimes, you (and by “you”, I mean me) need help figuring out how to create a PART for a control because,…

...  Read More

Create A Snapping Slider In Blend Using Behaviors (Silverlight 3 or WPF)

UPDATE: It turns out that in WPF, there is an easier way to snap the slider. For integers, simply check the “IsSnapToTickEnabled” and set your TickFrequency accordingly. Which means that this behavior is really only useful for Silverlight, which doesn’t have those properties. Behaviors are easily the coolest thing that has ever happened to anything….

...  Read More

Creating a Programmatic Path in Silverlight (or WPF)

Download Project Files for Creating a Programmatic Path in Silverlight or WPF (Note: The project is in Silverlight, but if you copy and paste the code into a WPF project, it should work without any changes) Have you ever wanted to create a Path programmatically or create a Path in code behind or dynamically build…

...  Read More

How To Get a Silverlight 3 AutoCompleteBox To Show Sample Data in Blend 3

Download Project Files for AutoCompleteBox Sample Data Project So you’re playing around with Silverlight in Blend 3 and you set up some sample data. (If you don’t know how to do that, I’ll get to that in this tutorial too.) Your sample data is all set up and you’ve attached it to your AutoComplete box……

...  Read More

Tip For Finding Resources for a Control in generic.xaml

I’ve recently be working on changing the ControlTemplate of a GridViewColumnHeader in a custom ListView that we’ve been working on. (The ListView was rewritten for sorting, so that’s why it had to be custom.) One of the things we had to do was swap out ControlTemplates so that we could display a caret to indicate…

...  Read More

Building a Silverlight ComboBox Using Attached Behaviors

I recently needed to use a ComboBox in an application I was writing.  Because there is no built-in ComboBox in Silverlight I decided to explore building one using attached behaviors.  If you’re not familiar with this design pattern, check out Nikhil’s posts.  My ComboBox behavior is loosely based on his AutoComplete behavior.  I also make…

...  Read More

Triggering Events and Updating Bindings

Sorry for the extended absence… I’m been working myself to the bone on the Veracity submission to the Show Off at MIX08. We’ll have some really kicking stuff to play around with at the Open Space… you should drop by and say hi. I look something like this: At least I look like that at 1:30…

...  Read More