Saturday, December 06, 2008

Back in November (yes, I'm still behind on my posts but catching up), Harry Pierson (IPy PM) announced his decision to write a series of posts on how to use IronPython with a range of different Microsoft technologies:

In the first part he starts a WPF based photo viewer for his wife's Windows Live photo collection.

"Turns out building this app in IPy was fairly straightforward, with a few pitfalls. I wasted half a day digging thru data binding before realized that data binding against IPy objects works out of the box - but only if you type the case of the property correctly (Title != title)..."

"Over the next several posts, I’m going to show you all the code for this app. It’s pretty small, only about 50 lines of app-specific python code + 50 lines of XAML to describe the window."

Downloading the RSS feeds used by the WL Spaces Photo Viewer can take several seconds. Harry illustrates how to move functions into the background (not holding up the GUI thread) using a thread pool. To keep things clean (and Pythonic) he uses decorators to execute functions in the background or on the UI thread.