AWDNUG June
Last night was our June meeting of the Albury/Wodonga .NET User Group, and since Anthony was away at a conference (meaning he'll have to give his Code Generation presentation next month) I filled in with "WPF - A Noob's Eye View".
The idea was to take a lot of the stuff I've learned over the last ten weeks of playing with WPF, and use it to give the guys a very brief introduction to the framework. I deliberately didn't prepare anything except an object model to code against (I used my Comicster.ObjectModel.dll file with its pre-existing classes), and made sure I had a full keyboard with me so I could type fast enough to not bore people.
Since I haven't installed any of the Expression tools or the Orcas CTP, I've been doing all my WPF coding in the raw XML in Visual Studio. I think it's a good way to learn what's happening "under the hood" and will serve me well when the tools mature. My introduction last night, therefore, was all XAML. I think it may have confused one or two people who have never thought about what happens behind the scenes when they visually design a form. That visual layout has to be stored somewhere - I guess most people don't think about it.
I started off by adding a few ListBox controls to a Grid in a form, and manually adding items to one of them. I then added an ObjectDataProvider and told it to call a method on a class I would write, which would get me some data to bind to. Nothing fancy - just created some Publisher objects in memory. From there we walked through binding one of the lists to that collection of publishers, and using a DataTemplate to control how each ListBoxItem was displayed.
I ended up briefly covering a few aspects of data binding (including binding to elements within the same window), templates, styles ... even touched on the idea of IValueConverters and ValidationRules.
I hope everyone found the presentation informative. I got ahead of myself a few times and had to backtrack, which is a good way of confusing your audience.
I'm now really looking forward to the code generation stuff next month. See you there!