Lately I've been busy learning about WPF and XAML, and I have to say that cool doesn't even begin to describe it. After TechEd 2007 I installed the Visual Studio Orcas Beta 1, and it's been a pretty smooth ride so far.
One of the first things I've been playing around with is adding some better visualizations to some existing stuff we're doing at work, and for that I've been trying to figure out what can be done with the ListView control in WPF so that I won't have to resort to third party grids immediately. The reason for that is that first of all I want to really understand what WPF can do for me before I resort to third party stuff that tries to wrap everything up nicely for me, and in addition to that I've had a lot of really bad experiences with the different control packages out there (I could write an essay on Infragistics, but I think I won't).
One pretty good source on how to do cell templates for the list view I found was on Corrado's Blogs. It's in Italian, but the pictures and XAML speak for themselves.
One "funny" thing that happened was when I in the Orcas Beta 1 was trying to create a column that would show a checkbox in the cell. I was trying to set the cell template to bind to a property of the object that was being shown in the list, while having the designer open (Orcas shows both the design surface and the XAML at the same time by default). I was still typing the binding string for the IsChecked property of my check box-based data template, and switched to another window to check what I was supposed to bind to, switched back and got the following error message:
Note the nice way it shows the actual exception. It has a scrollbar for the completely unnecessary error message telling me that the designer just went completely insane, but the actual error message it refuses to even wrap. Fair enough, I didn't have a correct string set up. But getting rid of this windows turned out to be quite hard. I clicked OK, and it popped up again. One more OK just resulted in one more window. After about 20 tries I realised that this was quite a persistent little bugger, and tried to figure out what I could do to get around this.
What I ended up having to do is click OK, type one or two characters before it popped up again, click OK, type some more, and that way I was able to enter "true" into IsChecked, and finally it stopped.
Chardonnay helped me calm down.
Comments