Saturday, June 20, 2009

Silverlight Tutorial - Image Button w/ TemplateBinding

** This post is not for my usual readers - you will be bored to tears. This post is for Silverlight Designers and Developers. **

I have been trying to figure how to make an image button in Silverlight that can use TemplateBinding to switch out the image. There seems to not be any clear instructions or tutorials out there, but I finally figured it out, so now I would like to share this extremely useful bit of information with you.

Below is a video/screencast of how to do it, but first I will just give you a brief description.
  1. Create a button
  2. Edit Template Style
  3. Put and image inside the Content Presenter
  4. In the XAML, select the Image and change it's Source to "{TemplateBinding Content}"
  5. Back on the main stage, type the image path inside of the Content field (Properties Panel)
  6. That's it (to add text, go back in the button and add a TextBox or ContentPresenter and set it's TemplateBinding to the "Tag" field and enter text there from the main stage

Sunday, June 7, 2009


Heard this old Pink Floyd song today. I haven't heard it in so long... What a great song.