However, they're a bit of a pain when it comes to Xaml. I hate having to wonder all the way up to the resources section(!), create my converter, think of a name for the key and finally reference the converter through a StaticResource markup extension.

Another thing I hate is the parsing of Converter Parameters back into the appropriate type. Boo.

A minor improvement IMO. But better nonetheless, provided we don't need to create lots of converters for all the different 'Factors' we might use... unless... we implement the Converter as a markup extension.

Comments are closed for this post.

Posted by
Sven
@
18 Apr 2009
2:01 PM
Sweet ! I see no reason not to "upgrade" all my existing converters to this state so I can choose whether to declare them as a resource or instantiate them inline withing the Converter={} clause.

I guess the disadvantage of this new instantiation method is that it creates a converter instance per Converter={} clause, right ?

Posted by
josh
@
18 Apr 2009
11:48 PM
Yes, if you think of that as a disadvantage. Of course, WPF is object heavy so any saving here (in terms of reducing the number of objects) is going to be negligible.

Posted by
OAB
@
27 Apr 2009
7:26 AM
Very cool. I had no idea it was that easy to write a markup extension. I will definitely be using this.