+1  A: 
Joel B Fant
If you mean: ItemsSource="{Binding Source={w:EnumValues EnumType={x:Type w:Test+TestEnum}}}" Then that just gave a big compilation fail
Peter M
Interesting. After answering, I started putting your example code together to recreate (just to see if it worked). I'll edit if I figure out anything.
Joel B Fant
Thanks for that. I'm too tired to bother with it right now but I will look t it first thing in the morning. I'm new to wpf and having to jump through these sorts of hoops to do what should be basic stuff is annoying me thoroughly.
Peter M
@Joel - I have implemented the Ty2Extension class and used our xaml, but it has not got me any further along. IN fact now I have more errors in the xaml "No constructor for type "Tye2extension" has 1 paramters" *and* "No constructor for type "EnumValuesExtension" has 1 parameters". But the code runs as expected and finds the enum. A genuine WTF!
Peter M
@Joel - Seeing that it works for you I am now wondering if there is an issue with my VS2008 SP1 install? BTW I only got your xaml to work with w:Test+TestEnum
Peter M
@Peter: Yes, it's supposed to be w:Test+TestEnum. The original used periods and I decided to change it while editing my answer. I do wonder if I changed something else. It wouldn't hurt to run Repair on your installation, just in case.
Joel B Fant
That's weird, for me it's working fine with "{w:EnumValues w:Test+TestEnum}"... I don't need a Type2Extension or anything like that
Thomas Levesque
@Thomas I know its weird. Thats why I am suspecting an installation problem on my machine. I'll have to try a repair or clean install and then see what happens.
Peter M
+2  A: 

Another way of getting the enum values for use as a data source:

<Window.Resources>
    <ObjectDataProvider
        MethodName="GetValues"
        ObjectType="{x:Type sys:Enum}"
        x:Key="TestValues">
        <ObjectDataProvider.MethodParameters>
            <w:Type2
                TypeName="w:Test+TestEnum" />
        </ObjectDataProvider.MethodParameters>
    </ObjectDataProvider>
</Window.Resources>

...

ItemsSource="{Binding Source={StaticResource TestValues}}"

Note that you still need the Type2Extension because of weirdness with TypeExtension and nested types. But you wouldn't need the extra custom markup extension. This way is better if you'll be using the list in multiple places, as you can declare it in your App.xaml resources.

Joel B Fant
Thank you very much for that - its has been driving me very crazy for far too long a time!
Peter M
Very nice - I was missing the "+" in declaring the enumeration in the MethodParameters, and it was driving me bonkers.
Wonko the Sane