Last Wednesday VB Central held another meeting at the pitoresque venue of Oosterkamp Training in Doorn, The Netherlands. The evening started of with Jacqueline van der Holst (senior developer at Avanade). She made her first public appearance with a talk on Linq. I think she did an excellent job covering Linq, given that Linq is a pretty hard and complex topic to learn, let alone talk about.
After the break I answered 5 common questions on Windows Presentation Foundation:
- Is it difficult?
- Windows or Web?
As always I put everyone’s patience to the test by going a good half hour over my alotted time of 1 hour 15 minutes. I had the impressions everyone was enjoying the things they were hearing about WPF. Thanks again for sitting it out.
The demo featured a +/- 40 line demo of XAML that showed it all:
- XAML syntax (property-element syntax, attached properties, markup extensions and so on)
- layout (panels and grids)
- resources (page and application level)
- templating (control templates, itempanel templates and datatemplates)
- data binding
- calling into CLR objects from XAML
- events (although I did not show this during the presentation)
I tried to squeeze in as much as possible. The end result, albeit simple in visuals, is shown as a Internet Explorer XBAP in the picture below.
Edwin Jongsma (also from Avanade) even challenged me to do a reflection of the whole button. I believe I did get close, but missed the Rectangle.Fill (stupid, stupid). Just to prove that it is easy, here is the completed result. A little more than the five lines of XAML I mentioned (those were just the Rectangle with a VisualBrush as the Fill), but this one has a transformation and opacity mask.
The fragment also shows the source of the Button control, but does not list the Style1 that is used. The bold part is the new code for the challenge.