Using a Generic IValueConverter from XAML

I have a generic class implementing IValueConverter. Something like:

class MyValueConverter<T> : IValueConverter

With XAML 2009, I can use it like this:

<my:MyValueConverter x:TypeArguments='x:String'/>

But apparently that's not allowed for "compiled" XAML (I guess we'll have to wait for .NET 5)

My current workaround is subclassing it for each usage:

class FooMyValueConverter : MyValueConverter<Foo>

Is it possible to do this in markup only using XAML 2006?

8
задан CodeNaked 29 April 2011 в 14:40
поделиться