In case you didn’t have time to prep for the Holidays, here’s a little Silverlight app to lift your spirits.
The app gives you a chance to do some tree decorating in the last-minute. You can click on the image to test it out. I hope you enjoy it!
HOW TO decorate the tree?
Clicking on an ornament will create a copy of the ornament, which can be moved over to the tree. If the moving ornament is dropped onto the tree, it will be placed on the tree. If dropped anywhere else than the tree, the moving ornament will disappear.
Ornaments on the tree have drag/drop functionality. So there’s some redecoration options for you. If an ornament on a tree is dropped out of the tree, it will be removed from your selected decorations.
Basic Info about the Silverlight app:
Most ornaments, the red/blue background images and the christmas tree itself, have all been created with free Photoshop brushes and then have been imported to Expression Blend. Since they were not ready to use vector images, I had to color all their details individually, which is a fun but rather time-consuming task.
The drag and drop functionality of the moving ornament is based on the MouseDragElementBehavior. It has been used for dynamically created images, so the behavior has also been created programmatically. But the C# coding is as straightforward as adding it in Expression Blend right out of the box.
The tree’s click boundaries have been defined through creating a path and using a WriteableBitmap, for collision detection. This was an easy and interesting task! You can find cool examples and detailed information on Andy Beaulieu’s web site.
Quick 2010 Update: You can get my source code from SkyDrive!