Beispiel #1
0
        /// <inheritdoc />
        protected override object?Convert(object?v, Type?t, object?p, CultureInfo?c)
        {
            if (First != null)
            {
                v = First.Convert(v, t, p, c);
            }
            if (Then != null)
            {
                v = Then.Convert(v, t, p, c);
            }
            var other = Other;

            //if (other != null) v = other.Where(converter => converter != null).Aggregate(v, (vv, converter) => converter.Convert(vv, t, p, c));
            if (other != null && other.Length > 0)
            {
                for (var i = 0; i < other.Length; i++)
                {
                    if (other[i] != null)
                    {
                        v = other[i].Convert(v, t, p, c);
                    }
                }
            }
            return(v);
        }
Beispiel #2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            object temp   = First.Convert(value, null, null, culture);
            object result = Second.Convert(temp, targetType, null, culture);

            return(result);
        }
        public override object Convert(object v, Type t, object p, CultureInfo c)
        {
            var result_1 = First?.Convert(v, t, p, c) ?? v;
            var result_2 = Second?.Convert(result_1, t, p, c) ?? result_1;

            return(result_2);
        }
Beispiel #4
0
        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var result1 = First?.Convert(value, targetType, parameter, culture) ?? value;
            var result2 = Second?.Convert(result1, targetType, parameter, culture) ?? result1;

            return(result2);
        }
 /// <summary>
 /// Modifies the source data before passing it to the target for display in the UI.
 /// </summary>
 /// <param name="value">The source data being passed to the target.</param>
 /// <param name="targetType">The <see cref="T:System.Type" /> of data expected by the target dependency property.</param>
 /// <param name="parameter">An optional parameter to be used in the converter logic.</param>
 /// <param name="culture">The culture of the conversion.</param>
 /// <returns>
 /// The value to be passed to the target dependency property.
 /// </returns>
 /// <exception cref="NullReferenceException">if value is null</exception>
 public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
 {
     return(Second.Convert(
                value: First.Convert(value, targetType, parameter, culture),
                targetType: targetType,
                parameter: parameter,
                culture: culture));
 }
Beispiel #6
0
        public override object Convert(object[] vv, Type t, object p, CultureInfo c)
        {
            var result = First.Convert(vv, t, p, c);
            var then   = Then;

            if (then != null)
            {
                result = then.Convert(result, t, p, c);
            }
            return(result);
        }
Beispiel #7
0
 public override object Convert(object v, Type t, object p, CultureInfo c)
 {
     if (First != null)
     {
         v = First.Convert(v, t, p, c);
     }
     if (Then != null)
     {
         v = Then.Convert(v, t, p, c);
     }
     return(v);
 }
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            object convertedValue = First.Convert(value, targetType, parameter, language);

            return(Second.Convert(convertedValue, targetType, parameter, language));
        }