Does WPF have a set of default binding converters available?
Asked Answered
C

1

0

When creating WPF user controls I often find myself creating small converter classes when binding values.

Often you need to do similar conversions, and it made me wonder whether I might be missing some existing available implementations.

  • Does the .NET library contain any implementations of IValueConverter or IMultiValueConverter?
  • Has there been any attempt made to create a library of reusable value converters?
Convector answered 5/3, 2012 at 0:39 Comment(1)
I just found WPF Converters. But I'm still interested in question 1.Convector
M
2

There are not many built-in, public are:

May have missed some...

Meijer answered 5/3, 2012 at 0:44 Comment(5)
Thanks, might I ask how you know this?Convector
@StevenJeuris: The one i mentioned is the only one that ever sees much use though...Meijer
Okay thanks, I just wanted to make sure I wasn't missing a ****load of classes I could have been using. You answered my questions sufficiently. When I have spare time it might be fun to write code which queries the entire library for classes which implement any of those interfaces. :)Convector
@StevenJeuris: There are already applications which do that, e.g. ILSpy which is mainly a decompiler also shows derived types. I just used that to check for the public converters in the .NET assemblies, as mentioned in the answer i may have missed some.Meijer
@StevenJeuris: The Microsoft.Expression.Framework assembly contains a lot of converters, don't know if that is included in the Blend SDK though, if so it might be worth a look.Meijer

© 2022 - 2024 — McMap. All rights reserved.