Q:

How can I make a loader animation that runs while code executes?

I have a page that runs a large amount of code to prepare the page and layout of the page for the user. 
It only needs to be used once in a blue moon. But when it does, it's about three seconds of wait for the user.
Apparently, Microsoft only allows a 2 or less second wait. Daaaaang.
I've optimized and optimized the code, and there's no way around it: the code is as fast as it can be. So naturally, I set out to make a loader.
I tried to update several controls, but thanks to the UI thread being frozen, they didn't work.
I searched and searched and searched, and found this, which was confusing and didn't really help, partly because of WP7's version of C# and partly because of me being a beginner at C#. 
How can I make a loader that works while the UI thread is frozen?

A:

The Silverlight Toolkit For Windows Phone introduces the PerformanceProgressBar, "which uses the compositor thread exclusively for animation, instead of the UI (user interface) thread" as described in this WindowsPhone Geek article. This should help you with the freezing UI.
As of the parallel execution (suggested by Merlyn), I'd suggest the QueueUserWorkItem method to execute code in a separate thread over the BackgroundWorker, leaving the UI thread active for UI updates, but as described in the article, you will need to use Dispatcher.BeginInvoke to update your UI from there.

