Tips and Tricks

I'd like to cover a couple of quick tips and tricks when working in WPF/E

3 Ways to Animate

Storyboards - Use this in the XAML to perform a variety of transformations on opacity, scale, rotation etc for individual or groups of elements. This is the most efficient way to animate elements, but not always the most flexible so a balance is good.

Javascript "onTick" - In my examples you will see I use an onTick function quite a bit. This is called when a 0 second Storyboard completes. This is very flexible, because you are using your own math/logic to animate things in a very dynamic way (see the snowflakes in the Winter Card), the downside is that JavaScript is not very fast, so be careful.

Javascript - Just using setInterval in JavaScript or animating things whenever you feel like it is the best way to crash the app and throw an error. The WPF/E control just might not be ready for you to act, so stick to onTick if you are doing a lot of continuous (non event based) animation.