Class ValueConverterGroup
- Namespace
- WindowSill.API
- Assembly
- WindowSill.API.dll
A value converter that applies multiple converters in sequence, passing the result of each converter as input to the next converter in the chain.
public class ValueConverterGroup : List<IValueConverter>, IList<IValueConverter>, ICollection<IValueConverter>, IReadOnlyList<IValueConverter>, IReadOnlyCollection<IValueConverter>, IEnumerable<IValueConverter>, IList, ICollection, IEnumerable, IValueConverter
- Inheritance
-
ValueConverterGroup
- Implements
- Inherited Members
- Extension Methods
Remarks
Usage example:
<Binding Path="PreviewFlyoutContent" RelativeSource="{RelativeSource TemplatedParent}">
<Binding.Converter>
<local:ValueConverterGroup>
<local:NullToBooleanConverter/>
<converters:BoolNegationConverter/>
</local:ValueConverterGroup>
</Binding.Converter>
<Binding.ConverterParameter>
<local:ValueConverterGroupParameters>
<x:Null/>
</local:ValueConverterGroupParameters>
</Binding.ConverterParameter>
</Binding>
Methods
Convert(object, Type, object, string)
Converts a value by applying each converter in the group sequentially.
public object Convert(object value, Type targetType, object parameter, string language)
Parameters
valueobjectThe value produced by the binding source.
targetTypeTypeThe type of the binding target property.
parameterobjectThe converter parameter to use. Must be null or a ValueConverterGroupParameters instance.
languagestringThe culture to use in the converter.
Returns
- object
The converted value after applying all converters in sequence.
Exceptions
- ArgumentException
Thrown when the parameter is not null or a ValueConverterGroupParameters instance.
ConvertBack(object, Type, object, string)
Converts a value back by applying the converters in reverse order. Currently not implemented.
public object ConvertBack(object value, Type targetType, object parameter, string language)
Parameters
valueobjectThe value that is produced by the binding target.
targetTypeTypeThe type to convert to.
parameterobjectThe converter parameter to use.
languagestringThe culture to use in the converter.
Returns
- object
A converted value.
Exceptions
- NotImplementedException
This method is not currently implemented.