This project is read-only.


Add Converter property to MultiConverterGroup


<p>Although ConverterGroup will chain a series of IValueConverters, and MultiConverterGroup will chain a series of IMultiValueConverters together, there doesn&#39;t seem to be any way of chaining a series of IMultiValueConverters into an IValueConverter.</p> <p>&nbsp;</p> <p>I think MultiConverterGroup should have a Converter property which takes an IValueConverter and applies this to it&#39;s result before returning.</p>

file attachments

Closed Sep 2, 2011 at 9:57 PM by
I am closing this even though I've not addressed it. That's because you can now use the ternary conditional operator to achieve the same effect. For example, an expression of:
{0} > 10 ? {1} : {2}
Will return value 1 if value 0 is greater than 10, otherwise it will return value 2.

Moreover, I wasn't able to envisage how this could be done more cleanly. If you disagree / don't think this solves your problem, please feel free to respond.


antidemon wrote Jun 8, 2011 at 1:28 PM

The attached change seems to do the trick.

kentcb wrote Sep 2, 2011 at 9:54 PM

V1.1.0.0 now supports this.

** Closed by kentcb 9/2/2011 1:53 PM

kentcb wrote Sep 2, 2011 at 9:54 PM

Wrong close comment.

barries wrote Apr 21, 2012 at 5:38 PM

Being able to funnel IMultiValueConverter output through an IValueConverter (including ConverterGroup) as the final step in a MultiConverterGroup. For example, being able to do a conversion, using ExpressionConverter, for example, that results in a bool then feed its result BooleanToVisibilityConverter would be very useful. It would also save having to bind two arguments to ExpressionConverter to Visibility.Visible and Visibility.Hidden or collapsed.

Another possibility would be to enable using IValueConverters in any step with automatic object[] unwrapping, where object[] could only contain a single value per IValueConverter.

Both would really enhance the expressiveness of MultiConverterGroup and reduce the number of times people try to "do it the obvious way" only to get errors and have to try some more awkward formulation.

Anyway, thanks for the library, very, very useful.