public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!ConvertBackSequence.Enumerate().Any())
            {
                throw new NotSupportedException();
            }

            var result = value;

            foreach (var converter in ConvertBackSequence)
            {
                result = converter.ConvertBack(result, targetType, parameter, culture);
            }

            return(result);
        }
Exemple #2
0
        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            if (ConvertBackFinishConverter == null)
            {
                throw new NotSupportedException();
            }
            if (!ConvertBackSequence.Enumerate().Any())
            {
                throw new NotSupportedException();
            }

            var result = value;

            foreach (var converter in ConvertBackSequence)
            {
                result = converter.ConvertBack(result, targetTypes.FirstOrDefault(), parameter, culture);
            }

            return(ConvertBackFinishConverter.ConvertBack(result, targetTypes, parameter, culture));
        }