示例#1
0
        protected virtual MultiBindingExpression ProvideStandardMultiBindingExp(IServiceProvider serviceProvider,
                                                                                BindingTarget bindingTarget, MyBindingInfo bInfo, Type sourceType)
        {
            // create wpf binding
            MyMultiValueConverter mValueConverter = new MyMultiValueConverter(BindingInfo.Mode);

            Binding binding = CreateDefaultBinding(bindingTarget, bInfo, sourceType, bInfo.PropertyPath);

            // This also sets the binding.
            MultiBindingExpression mExp = BuildMultiBindingExpression(serviceProvider, binding, isCustom: false);

            return(mExp);

            //// TODO: Should we SetTheBinding here? We need to test this.
            //return WrapBindingInMultiValueConverter(serviceProvider, binding, binding.Mode);
        }
示例#2
0
        protected virtual MultiBindingExpression WrapBindingInMultiValueConverter(IServiceProvider serviceProvider,
                                                                                  Binding binding, BindingMode mode)
        {
            // create wpf binding

            MyMultiValueConverter mValueConverter = new MyMultiValueConverter(mode);

            if (binding != null)
            {
                mValueConverter.Add(binding);
            }

            // return the expression provided by the multi-binding
            MultiBindingExpression exp = mValueConverter.GetMultiBindingExpression(serviceProvider);

            return(exp);
        }