I have a complicated relationship with WPF. When you know what you're doing, it's great for building desktop apps. It's much easier to handle scenarios like apps getting used across varying DPIs, or doing complex UI layouts. But there are a few bits of it which, when you don't know how to do them, aren't intuitive. I bumped into another one the other day: Needing to trigger an animation on-demand. And so I can remember this next time I need to do this, here's a quick write-up of one way to achieve it...
I realised recently that I've become quite used to way many web forms let you paste image data straight into a text field. The behaviour of "upload the image data, and insert the correct mark-up for the image" is a really helpful shortcut when you're editing DevOps tickets, or Stack Overflow answers. So I started wondering how easy it would be to add that to the text editing tool I use for writing these blog posts. Turns out, not too hard, because WPF has some helpful extension patterns...