Friday, 29 December 2006

WPF/XAML - x:Type and nested classes

Well now I am getting started with XAML and WPF I am hoping to start blogging a bit more! So I was trying to reference a nested type with the {x:Type} markup extension and it wasn't working. Say you have a class as follows:

public class MyClass
    public class MyInnerClass

You want to reference the inner class (e.g. for a DataTemplate). The following XAML does not work

<DataTemplate DataType="{x:Type MyClass.MyInnerClass}">

What you need to do is:

<DataTemplate DataType="{x:Type MyClass+MyInnerClass}">

Thanks to Seb for the hint on that one!

Friday, 7 April 2006

Great tutorial on JavaScript

This is a fantastic article on Javascript IMHO, perfectly aimed at a developer like myself who has lots of programming experience but not so much knowledge of Javascript.

The bits on closures and IE Memory Leaks was especially well explained, as that's something I've come across but never really understood!

And here's a link to his blog on the matter: