| Playing with WPF |
[19 May 2009|06:49pm] |
|
Have got some free time at the moment so this week have been teaching myself Windows Presentation Foundation (WPF) yesterday / today by re-writing my pet project to re-size / re-"aspect ratio"* photos for emailing / putting on photo frame / printing.
It's been a good little project to learn stuff** - wrote it initially in .NET 1.0 a few years back, added BackgroundWorker and application settings when .NET 2.0 came out and last xmas I did some major refactoring 'cos it was starting and hence needed to be more base class / interface driven***.
Anyhow I've made a first stab at writing it as a WPF application and so far here were a few things that didn't sit right: I get markup + code and separating out styles being a (mostly) ASP.NET programmer but in the MSDN demos I've seen hacks to reference the markup defined object from the code files and I've seen styles stuck in data templates neither of which feel right. I'm hoping that the these are just shortcuts done for the purposes of writing demos and that if I play with a little more something will click so that it all makes sense and I'll blog more about this when it does. Certainly I've already simplified some of the bits in the demo (with the help of other's blogs) so that they seem more reasonable to my mind.
Of course one big win is the ability to turn it into an XBAP but I think I need to walk before I try to run :-)
* the place I use to print photos will crop the photos if they don't fit the 6x4 or 7x5 aspect ratio so I add a border to them first; it means you get some whitespace on the printed photo but that's better than chopping people's heads / feet off!
** It's also useful 'cos I wouldn't have liked to resize the 1000+ photos I put on my photo frame by hand in PaintShopPro or similar!
*** I also added displaying EXIF information and different smoothing and interpolation modes to the settings to better shrink photos for emailing or adding 1000+ photos to the small memory card in my photo frame
|
|