Ejemplo n.º 1
0
        /// <summary>
        /// Get the raw proposed value
        /// <summary>
        internal override object GetRawProposedValue()
        {
            BindingExpressionBase bindExpr = ActiveBindingExpression;

            if (bindExpr != null)
            {
                return(bindExpr.GetRawProposedValue());
            }
            return(DependencyProperty.UnsetValue);
        }
        // Token: 0x06001C79 RID: 7289 RVA: 0x00085EE4 File Offset: 0x000840E4
        internal override object GetRawProposedValue()
        {
            BindingExpressionBase activeBindingExpression = this.ActiveBindingExpression;

            if (activeBindingExpression != null)
            {
                return(activeBindingExpression.GetRawProposedValue());
            }
            return(DependencyProperty.UnsetValue);
        }
Ejemplo n.º 3
0
        // Token: 0x06001C2E RID: 7214 RVA: 0x000844B0 File Offset: 0x000826B0
        private bool ConvertProposedValueImpl(object value, out object result)
        {
            DependencyObject targetElement = base.TargetElement;

            if (targetElement == null)
            {
                result = DependencyProperty.UnsetValue;
                return(false);
            }
            result = this.GetValuesForChildBindings(value);
            if (base.IsDetached)
            {
                return(false);
            }
            if (result == DependencyProperty.UnsetValue)
            {
                base.SetStatus(BindingStatusInternal.UpdateSourceError);
                return(false);
            }
            object[] array = (object[])result;
            if (array == null)
            {
                if (TraceData.IsEnabled)
                {
                    TraceData.Trace(TraceEventType.Error, TraceData.BadMultiConverterForUpdate(new object[]
                    {
                        this.Converter.GetType().Name,
                        AvTrace.ToStringHelper(value),
                        AvTrace.TypeName(value)
                    }), this);
                }
                result = DependencyProperty.UnsetValue;
                return(false);
            }
            if (TraceData.IsExtendedTraceEnabled(this, TraceDataLevel.Transfer))
            {
                for (int i = 0; i < array.Length; i++)
                {
                    TraceData.Trace(TraceEventType.Warning, TraceData.UserConvertBackMulti(new object[]
                    {
                        TraceData.Identify(this),
                        i,
                        TraceData.Identify(array[i])
                    }));
                }
            }
            int num = this.MutableBindingExpressions.Count;

            if (array.Length != num && TraceData.IsEnabled)
            {
                TraceData.Trace(TraceEventType.Information, TraceData.MultiValueConverterMismatch, new object[]
                {
                    this.Converter.GetType().Name,
                    num,
                    array.Length,
                    TraceData.DescribeTarget(targetElement, base.TargetProperty)
                });
            }
            if (array.Length < num)
            {
                num = array.Length;
            }
            bool result2 = true;

            for (int j = 0; j < num; j++)
            {
                value = array[j];
                if (value != Binding.DoNothing && value != DependencyProperty.UnsetValue)
                {
                    BindingExpressionBase bindingExpressionBase = this.MutableBindingExpressions[j];
                    bindingExpressionBase.SetValue(targetElement, base.TargetProperty, value);
                    value = bindingExpressionBase.GetRawProposedValue();
                    if (!bindingExpressionBase.Validate(value, ValidationStep.RawProposedValue))
                    {
                        value = DependencyProperty.UnsetValue;
                    }
                    value = bindingExpressionBase.ConvertProposedValue(value);
                }
                else if (value == DependencyProperty.UnsetValue && TraceData.IsEnabled)
                {
                    TraceData.Trace(TraceEventType.Information, TraceData.UnsetValueInMultiBindingExpressionUpdate(new object[]
                    {
                        this.Converter.GetType().Name,
                        AvTrace.ToStringHelper(value),
                        j,
                        this._tempTypes[j]
                    }), this);
                }
                if (value == DependencyProperty.UnsetValue)
                {
                    result2 = false;
                }
                array[j] = value;
            }
            Array.Clear(this._tempTypes, 0, this._tempTypes.Length);
            result = array;
            return(result2);
        }