Sunday, October 17, 2010

Wpf progress animation

So. We've done a hell of a lot of optimization work, which basically began by rewriting our Command architectures to work off the Dispatcher thread by default. This naturally induced a whole lot of runtime errors which needed to be sorted out one by one as we identified operations which rightly belonged onthread, manipulating or querying UserControls as they did. However, every single operation which did NOT throw said runtime exception was now operating in the background.

The app is fast now. Maybe 3 times, conservatively speaking. So how do I make it faster? I probably don't. That's actually fast enough. But now that we've got our Dispatcher nice and responsive again it's time to use that and add some perceived speed increases too, so that everyone agrees we must have sped up by at least 10 times. Don't ask me to measure that, it's hyperbole. Which is always six inches long.

So. The best speed increase I can think of which is a low hanging cherry is to add wait animations on all our network actions. That's login, conversation join, slide move. The other stuff is pretty much ok. Maybe file upload too.

So how do we do that in WPF? We could just go and grab an animated gif. Badda bing, done. But I'd like it to be a little nicer than that. I won't be doing a great big complex animation like the gears used to be, but similar principles.

For best value, I'd like this animation to be in the visual tree of the main window, at the front, and collapsed. It's also almost completely transparent, and permits clickthrough. Maybe. Maybe it blocks, we'll have to see whether cancelling out is actually a good idea when it's up.

So.



...All the actual contents





We're not explicitly sizing it so it will fit nicely into its parent. Next: The actual markup to create an animated progress blocker.

No comments:

Post a Comment