Example #1
0
        //public void ClearBorderColor()
        //{
        //    textBox.BorderBrush = new SolidColorBrush(UIManager.GetColorFromInfoColor(InfoColor.Black));
        //    textBox.BorderThickness = new Thickness(1);
        //}
        public void SetBinding(EntityInstanceProperty property)
        {
            Binding binding = new Binding("Value");

            binding.Source = property;
            binding.Mode   = BindingMode.TwoWay;
            if (textBox is PDatePicker)
            {
                if (valueIsString && stringDateIsMiladi == false)
                {
                    textBox.SetBinding(PDatePicker.SelectedPersianDateProperty, binding);
                }
                else
                {
                    textBox.SetBinding(PDatePicker.SelectedDateProperty, binding);
                }
            }
            else
            {
                if (valueIsString && stringDateIsMiladi == false)
                {
                    binding.Converter = new ConverterDate();
                    textBox.SetBinding(DatePicker.SelectedDateProperty, binding);
                }
                else
                {
                    textBox.SetBinding(DatePicker.SelectedDateProperty, binding);
                }
            }
        }
Example #2
0
        /// <summary>
        /// Utility methods that is used to bind the EditProps of the
        /// BaseElement model to the layout elements.
        /// </summary>
        protected virtual void BindLayoutToEditProps(Control control)
        {
            //Bind this model to the element
            Binding bindXPos = new Binding("XPos");

            bindXPos.Source = this;
            bindXPos.Mode   = BindingMode.TwoWay;
            control.SetBinding(Canvas.LeftProperty, bindXPos);

            Binding bindYPos = new Binding("YPos");

            bindYPos.Source = this;
            bindYPos.Mode   = BindingMode.TwoWay;
            control.SetBinding(Canvas.TopProperty, bindYPos);

            Binding bindWidth = new Binding("Width");

            bindWidth.Source = this;
            bindWidth.Mode   = BindingMode.TwoWay;
            control.SetBinding(TemplateUserControl.WidthProperty, bindWidth);

            Binding bindHeight = new Binding("Height");

            bindHeight.Source = this;
            bindHeight.Mode   = BindingMode.TwoWay;
            control.SetBinding(TemplateUserControl.HeightProperty, bindHeight);

            Binding bindRotation = new Binding("Rotation");

            bindRotation.Source    = this;
            bindRotation.Mode      = BindingMode.TwoWay;
            bindRotation.Converter = new RotateToTransformConverter();
            control.SetBinding(TemplateUserControl.RenderTransformProperty, bindRotation);
        }
Example #3
0
        public static void LoadAndMonitor(INotifyPropertyChanged source, string sourceProperty, Control control, DependencyProperty controlProperty = null, IValueConverter converter = null, BindingMode mode = BindingMode.Default)
        {
            var p       = controlProperty ?? GetProperty(control);
            var binding = new System.Windows.Data.Binding(sourceProperty);

            binding.Source    = source;
            binding.IsAsync   = true;
            binding.Converter = converter;
            binding.Mode      = mode;
            // Set UpdateSourceTrigger to PropertyChanged, otherwise control to object update won't trigger.
            binding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
            if (converter is Converters.PaddSettingToText)
            {
                var padValidator = new Converters.PadSettingToTextValidator();
                binding.ValidationRules.Add(padValidator);
                control.SetBinding(p, binding);
            }
            else if (converter != null)
            {
                binding.Mode = BindingMode.OneWayToSource;
                var value = source.GetType().GetProperty(sourceProperty).GetValue(source);
                var v     = converter.Convert(value, null, null, null);
                control.SetBinding(p, binding);
                control.SetValue(p, v);
            }
            else
            {
                control.SetBinding(p, binding);
            }
        }
        protected virtual void BindingDatePicker <T>(Control control, Expression <Func <T> > action, bool validate = false, Func <ValidationRule> validationRule = null)
        {
            // BindingItem1(control, DatePicker.SelectedDateProperty,  GetPropertyPath(action), "dd.MM.yyyy");

            string stringFormat = "dd.MM.yyyy";
            var    binding      = new Binding(GetPropertyPath(action))
            {
                Source = this,
            };

            binding.Mode = BindingMode.TwoWay;
            binding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;

            binding.StringFormat = stringFormat;
            //binding.Converter = new Liftmanagement.Converters.DateDateConverter();

            control.SetBinding(DatePicker.SelectedDateProperty, binding);
            control.SetBinding(DatePicker.TextProperty, binding);

            //if (validate && validationRule != null)
            //{
            //    Binding bindingtxt = BindingOperations.GetBinding(control, DatePicker.TextProperty);
            //    bindingtxt.ValidationRules.Clear();
            //    bindingtxt.ValidationRules.Add(validationRule());
            //    control.LostFocus += DatePicker_LostFocus; ;
            //}
        }
        //public void ClearBorderColor()
        //{
        //    textBox.BorderBrush = new SolidColorBrush(UIManager.GetColorFromInfoColor(InfoColor.Black));
        //    textBox.BorderThickness = new Thickness(1);
        //}
        public void SetBinding(EntityInstanceProperty property)
        {
            Binding binding = new Binding("Value");

            binding.Source = property;
            binding.Mode   = BindingMode.TwoWay;
            if (valueIsString)
            {
                if (stringTimeISAMPMFormat == true)
                {
                    if (stringTimeIsMiladi == false)
                    {
                        binding.Converter = new ConverterAMPMShamsi();
                        textBox.SetBinding(RadTimePicker.SelectedValueProperty, binding);
                    }
                    else
                    {
                        binding.Converter = new ConverterAMPM();
                        textBox.SetBinding(RadTimePicker.SelectedValueProperty, binding);
                    }
                }
                else
                {
                    binding.Converter = new ConverterLongTime();
                    textBox.SetBinding(RadTimePicker.SelectedValueProperty, binding);
                }
            }
            else
            {
                textBox.SetBinding(RadTimePicker.SelectedValueProperty, binding);
            }
        }
        public static void LoadAndMonitor(INotifyPropertyChanged source, string sourceProperty, Control control, DependencyProperty controlProperty = null, IValueConverter converter = null, BindingMode mode = BindingMode.Default)
        {
            var p       = controlProperty ?? GetProperty(control);
            var binding = new System.Windows.Data.Binding(sourceProperty);

            binding.Source    = source;
            binding.IsAsync   = true;
            binding.Converter = converter;
            binding.Mode      = mode;
            if (converter is Converters.PaddSettingToText)
            {
                binding.Mode = BindingMode.OneWay;
                control.SetBinding(p, binding);
            }
            else if (converter != null)
            {
                binding.Mode = BindingMode.OneWayToSource;
                var value = source.GetType().GetProperty(sourceProperty).GetValue(source);
                var v     = converter.Convert(value, null, null, null);
                control.SetBinding(p, binding);
                control.SetValue(p, v);
            }
            else
            {
                control.SetBinding(p, binding);
            }
        }
Example #7
0
        public static void SetBinding(Control ctrl, DependencyProperty prop, string path, BindingMode mode)
        {
            Binding bi = new Binding(path);

            bi.Mode = mode;
            ctrl.SetBinding(prop, bi);
        }
Example #8
0
        protected override void OnElementChanged(ElementChangedEventArgs <TableView> e)
        {
            if (e.OldElement != null)
            {
                e.OldElement.ModelChanged -= OnModelChanged;
            }

            if (e.NewElement != null)
            {
                if (Control == null)
                {
                    SetNativeControl(new Microsoft.UI.Xaml.Controls.ListView
                    {
                        ItemContainerStyle = (Microsoft.UI.Xaml.Style)Microsoft.UI.Xaml.Application.Current.Resources["FormsListViewItem"],
                        ItemTemplate       = (Microsoft.UI.Xaml.DataTemplate)Microsoft.UI.Xaml.Application.Current.Resources["CellTemplate"],
                        GroupStyle         = { new GroupStyle {
                                                   HidesIfEmpty = false, HeaderTemplate = (Microsoft.UI.Xaml.DataTemplate)Microsoft.UI.Xaml.Application.Current.Resources["TableSection"]
                                               } },
                        HeaderTemplate = (Microsoft.UI.Xaml.DataTemplate)Microsoft.UI.Xaml.Application.Current.Resources["TableRoot"],
                        SelectionMode  = Microsoft.UI.Xaml.Controls.ListViewSelectionMode.Single
                    });

                    // You can't set ItemsSource directly to a CollectionViewSource, it crashes.
                    Control.SetBinding(WItemsControl.ItemsSourceProperty, "");
                    Control.SelectionChanged += OnSelectionChanged;
                }

                e.NewElement.ModelChanged += OnModelChanged;
                OnModelChanged(e.NewElement, EventArgs.Empty);
            }

            base.OnElementChanged(e);
        }
        protected override void OnElementChanged(ElementChangedEventArgs <SwitchView> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
            }
            if (e.NewElement != null)
            {
                if (Control == null)
                {
                    var control = new NativeSwitchView();
                    SetNativeControl(control);
                }
                else
                {
                    Control.ClearValue(NativeSwitchView.ValueProperty);
                    Control.ClearValue(NativeSwitchView.OnColorProperty);
                }

                var binding1 = new Binding()
                {
                    Source = e.NewElement, Path = new PropertyPath(nameof(SwitchView.Value)), Mode = BindingMode.TwoWay
                };
                var binding2 = new Binding()
                {
                    Source = e.NewElement, Path = new PropertyPath(nameof(SwitchView.OnColor)), Converter = new ColorConverter()
                };
                Control.SetBinding(NativeSwitchView.ValueProperty, binding1);
                Control.SetBinding(NativeSwitchView.OnColorProperty, binding2);
            }
        }
Example #10
0
        protected override void OnElementChanged(ElementChangedEventArgs <GIFView> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
            }
            if (e.NewElement != null)
            {
                if (Control == null)
                {
                    var control = new NativeGIFView();
                    SetNativeControl(control);
                }
                else
                {
                    Control.ClearValue(NativeGIFView.SourceProperty);
                    Control.ClearValue(NativeGIFView.StretchProperty);
                }

                var binding1 = new Binding()
                {
                    Source = e.NewElement, Path = new PropertyPath(nameof(GIFView.Source))
                };
                var binding2 = new Binding()
                {
                    Source = e.NewElement, Path = new PropertyPath(nameof(GIFView.Stretch)), Converter = new StretchConverter()
                };
                Control.SetBinding(NativeGIFView.SourceProperty, binding1);
                Control.SetBinding(NativeGIFView.StretchProperty, binding2);
            }
        }
Example #11
0
 /// <summary>
 /// Apply a binding on the DependencyProperty "prop" on control if the current binding is null
 /// </summary>
 /// <param name="control"></param>
 /// <param name="prop"></param>
 /// <param name="binding"></param>
 public static void SetBindingIfNull(this Control control, DependencyProperty prop, string binding)
 {
     if (!control.HasBinding(prop))
     {
         control.SetBinding(prop, binding);
     }
 }
 public TemplateableDraggablePoint()
 {
     marker.SetBinding(Control.TemplateProperty, new Binding {
         Source = this, Path = new PropertyPath("MarkerTemplate")
     });
     Content = marker;
 }
        public static void BindProperty(Control control, object source, string path,
                                        DependencyProperty property, BindingMode mode)
        {
            var binding = new Binding(path);

            binding.Source = source;
            binding.Mode   = mode;
            control.SetBinding(property, binding);
        }
Example #14
0
        public static void LoadAndMonitor(INotifyPropertyChanged source, string sourceProperty, Control control, DependencyProperty controlProperty = null)
        {
            var p       = controlProperty ?? GetProperty(control);
            var binding = new System.Windows.Data.Binding(sourceProperty);

            binding.Source  = source;
            binding.IsAsync = true;
            control.SetBinding(p, binding);
        }
Example #15
0
        public static void SetBindingElement(this Control ctrl, DependencyProperty strlProp, Control src, string srcPath)
        {
            Binding bi = new Binding(srcPath)
            {
                Source = src,
                Mode   = BindingMode.TwoWay
            };

            ctrl.SetBinding(strlProp, bi);
        }
        protected virtual void BindingComboBoxText <T>(Control control, Expression <Func <T> > action)
        {
            var binding = new Binding(GetPropertyPath(action))
            {
                Source = this,
            };

            binding.Mode = BindingMode.TwoWay;

            control.SetBinding(ComboBox.TextProperty, binding);
        }
        protected virtual void BindingComboBoxSelectedValue <T>(Control control, Expression <Func <T> > action)
        {
            var binding = new Binding(ViewModelName + "." + GetPropertyPath(action))
            {
                Source = this,
            };

            binding.Mode = BindingMode.TwoWay;

            control.SetBinding(ComboBox.SelectedValueProperty, binding);
        }
Example #18
0
        public void bind(T name, Control ctl, DependencyProperty bindType, object initData = null)
        {
            BindBase md = new BindBase();

            md.data = initData;
            ctl.SetBinding(bindType, new Binding("data")
            {
                Source = md, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });
            mapData[name] = md;
        }
        protected virtual void BindingDatetime <T>(Control control, Expression <Func <T> > action)
        {
            var binding = new Binding(GetPropertyPath(action))
            {
                Source = this,
            };

            binding.Converter = new Liftmanagement.Converters.DateTimeConverter();;

            control.SetBinding(TextBox.TextProperty, binding);
        }
Example #20
0
 /// <summary>
 /// Apply a binding for the fixed settings to the control
 /// </summary>
 /// <param name="control">Control to bind the IsEnabled to</param>
 /// <param name="configPath">Config path, e.g CoreConfig or Config</param>
 /// <param name="configProperty">Property in the config</param>
 /// <param name="dependsOnIsChecked">This control is only enabled if the dependsOnIsChecked element is checked</param>
 public static void ApplyFixedBinding(this Control control, string configPath, string configProperty, string dependsOnIsChecked)
 {
     if (!control.HasBinding(Control.IsEnabledProperty))
     {
         Binding isEnabledBinding = new Binding(string.Format("{0}[{1}].IsEditable", configPath, configProperty));
         if (dependsOnIsChecked == null)
         {
             control.SetBinding(Control.IsEnabledProperty, isEnabledBinding);
         }
         else
         {
             MultiBinding multiBinding = new MultiBinding();
             multiBinding.Converter = new AndBooleanConverter();
             multiBinding.Bindings.Add(isEnabledBinding);
             Binding dependsOnBinding = new Binding("IsChecked");
             dependsOnBinding.ElementName = dependsOnIsChecked;
             multiBinding.Bindings.Add(dependsOnBinding);
             control.SetBinding(Control.IsEnabledProperty, multiBinding);
         }
     }
 }
Example #21
0
 /// <summary>
 /// Apply a binding for the expert settings to the control
 /// </summary>
 /// <param name="control">Control to bind the VisibilityProperty to</param>
 /// <param name="configPath">Config path, e.g CoreConfig or Config</param>
 /// <param name="configProperty">Property in the config</param>
 public static void ApplyExpertSettingsBinding(this Control control, string configPath, string configProperty)
 {
     if (!control.HasBinding(Control.VisibilityProperty))
     {
         MultiBinding multiBinding = new MultiBinding();
         multiBinding.Converter = new OrBooleanConverter();
         Binding propertyVisibleBinding = new Binding(string.Format("{0}[{1}].IsVisible", configPath, configProperty));
         propertyVisibleBinding.Converter = new BooleanToVisibilityConverter();
         multiBinding.Bindings.Add(propertyVisibleBinding);
         Binding showExpertBinding = new Binding("CoreConfig.ShowExpertSettings");
         showExpertBinding.Converter = new BooleanToVisibilityConverter();
         multiBinding.Bindings.Add(showExpertBinding);
         control.SetBinding(Control.VisibilityProperty, multiBinding);
     }
     if (!control.HasBinding(Control.FontWeightProperty))
     {
         Binding propertyExpertBinding = new Binding(string.Format("{0}[{1}].IsExpert", configPath, configProperty));
         propertyExpertBinding.Converter = new BoolToFontWeightConverter();
         control.SetBinding(Control.FontWeightProperty, propertyExpertBinding);
     }
 }
        /// <summary>
        /// Sets the background binding.
        /// </summary>
        /// <param name="d">The cell definition.</param>
        /// <param name="c">The control.</param>
        protected virtual void SetBackgroundBinding(CellDefinition d, Control c)
        {
            if (d.BackgroundBindingPath == null)
            {
                return;
            }

            var binding = new Binding(d.BackgroundBindingPath)
            {
                Source = d.BackgroundBindingSource
            };

            c.SetBinding(Control.BackgroundProperty, binding);
        }
        public ValidatableEntryControl()
        {
            Control.BindingContext = this;
            Control.SetBinding(Entry.TextProperty, "EntryText");

            Children.Add(Control);

            MessageLabel.SetBinding(VisualElement.IsVisibleProperty, "IsInValid");
            MessageLabel.SetBinding(Label.TextProperty, "Message");
            MessageLabel.BindingContext = this;
            MessageLabel.TextColor      = Color.Red;

            Children.Add(MessageLabel);
        }
Example #24
0
        protected override void OnElementChanged(ElementChangedEventArgs <Picker> e)
        {
            base.OnElementChanged(e);

            if (e.NewElement != null)
            {
                var b = new Windows.UI.Xaml.Data.Binding()
                {
                    Mode   = Windows.UI.Xaml.Data.BindingMode.OneWay,
                    Path   = new Windows.UI.Xaml.PropertyPath("FontSize"),
                    Source = e.NewElement
                };
                Control.SetBinding(ComboBox.FontSizeProperty, b);
            }
        }
        protected virtual void BindingItem1(Control control, DependencyProperty dp, string path, string stringFormat = null)
        {
            var binding = new Binding(path)
            {
                Source = this,
            };

            binding.Mode = BindingMode.TwoWay;

            if (stringFormat != null)
            {
                binding.StringFormat = stringFormat;
            }

            control.SetBinding(dp, binding);
        }
        /// <summary>
        /// Create a Node for a feature layer in an ArcGIS Dynamic Map Service Layer
        /// </summary>
        private TreeViewItem CreateFeatureLayerNode(string mapID, string lyrName, int lyrID, double minScale, double maxScale, bool visible, bool hasSubLayer, bool toggleLayer)
        {
            Control      checkButton = null;
            TreeViewItem childItem   = new TreeViewItem();

            childItem.Tag = new TOCNodeInfo()
            {
                MapID = mapID, LayerID = lyrID, IsGroupLayer = hasSubLayer
            };

            if (toggleLayer)
            {
                RadioButton radioBox = new RadioButton();
                checkButton                    = radioBox;
                radioBox.Tag                   = childItem;
                radioBox.Content               = lyrName;
                radioBox.IsChecked             = visible;
                radioBox.GroupName             = "Radio_" + mapID;
                radioBox.Click                += new RoutedEventHandler(OnToggleFeatureLayer);
                radioBox.MouseRightButtonDown += new MouseButtonEventHandler(LayerNode_RightClick);
            }
            else
            {
                CheckBox checkBox = new CheckBox();
                checkButton                    = checkBox;
                checkBox.Tag                   = childItem;
                checkBox.Content               = lyrName;
                checkBox.IsChecked             = visible;
                checkBox.Click                += new RoutedEventHandler(OnToggleFeatureLayer);
                checkBox.MouseRightButtonDown += new MouseButtonEventHandler(LayerNode_RightClick);
            }

            if (minScale > 0.0 || maxScale > 0.0)
            {
                Binding scaleBinding = new Binding("MapScale")
                {
                    ConverterParameter = new double[2] {
                        minScale, maxScale
                    }, Converter = scaleConverter
                };
                checkButton.DataContext = this.CurrentPage;
                checkButton.SetBinding(Control.ForegroundProperty, scaleBinding);
            }

            childItem.Header = checkButton;
            return(childItem);
        }
Example #27
0
        /// <summary>
        /// Binds a Control's Visibility property to its IsEnabled property from code-behind.
        /// </summary>
        /// <param name="control">The control to hide when disabled and show when enabled.</param>
        /// <remarks>Depends on BooleanToVisibilityConverter being defined as an app resource.</remarks>
        public static void HideWhenDisabled(this Control control)
        {
            control.ClearValue(Control.VisibilityProperty);
            control.SetBinding(
                Control.VisibilityProperty,
                new Binding
            {
                Source    = control,
                Path      = new PropertyPath("IsEnabled"),
                Converter = (IValueConverter)Application.Current.Resources["BooleanToVisibilityConverter"],
                Mode      = BindingMode.OneWay
            }
                );

            control.IsEnabledChanged += (s, e) =>
            {
                DebugHelper.Trace("IsEnabledChanged");
            };
        }
        protected virtual void MultiBindingLabel <T>(Control control, Expression <Func <T> > action1, Expression <Func <T> > action2)
        {
            Binding binding1 = new Binding(GetPropertyPath(action1))
            {
                Source = this
            };

            Binding binding2 = new Binding(GetPropertyPath(action2))
            {
                Source = this
            };

            MultiBinding mb = new MultiBinding();

            mb.Bindings.Add(binding1);
            mb.Bindings.Add(binding2);
            mb.Converter = new LabelMultiValueConverter();

            control.SetBinding(Label.ContentProperty, mb);
        }
Example #29
0
        public UIElement Visit(ComputedQuestion question)
        {
            QuestionControl questionControl = new QuestionControl(question.Id);

            questionControl.AddQuestionLabel(question.Text);
            Control ioControl = question.Type.Accept <UIElement>(this) as Control;

            // create binding to control (writes value of questionControl to value of ioControl)
            Binding bind = new Binding("MyValue");

            bind.Source                = questionControl;
            bind.Converter             = question.Type.Accept <IValueConverter>(new ConverterVisitor()) as IValueConverter;
            bind.Mode                  = BindingMode.OneWay;
            bind.FallbackValue         = "";
            bind.UpdateSourceTrigger   = UpdateSourceTrigger.PropertyChanged;
            bind.NotifyOnTargetUpdated = true;
            ioControl.SetBinding(question.Type.Accept <DependencyProperty>(new DependencyPropertyVisitor()) as DependencyProperty, bind);
            questionControl.AddIOControl(ioControl, false);
            this._computedList.Add(new Tuple <QSExpression, UIElement>(question.Expression, questionControl));
            return(questionControl);
        }
Example #30
0
        public UIElement Visit(Question question)
        {
            QuestionControl questionControl = new QuestionControl(question.Id);

            questionControl.AddQuestionLabel(question.Text);
            Control ioControl = question.Type.Accept <UIElement>(this) as Control;

            // create binding to control (writes value of ioControl to value of questionControl)
            Binding bind = new Binding("MyValue");

            bind.Source                = questionControl;
            bind.Converter             = question.Type.Accept <IValueConverter>(new ConverterVisitor()) as IValueConverter;
            bind.Mode                  = BindingMode.OneWayToSource;
            bind.UpdateSourceTrigger   = UpdateSourceTrigger.PropertyChanged;
            bind.NotifyOnSourceUpdated = true;
            ioControl.SetBinding(question.Type.Accept <DependencyProperty>(new DependencyPropertyVisitor()) as DependencyProperty, bind);
            questionControl.SourceUpdated += new EventHandler <DataTransferEventArgs>(questionControl_SourceUpdated);
            questionControl.AddIOControl(ioControl, true);

            this._evaluator.SetValue(question.Id, question.Type.GetUndefined());
            questionControl.MyValueChanged += new DependencyPropertyChangedEventHandler(questionControl_ContentChanged);
            return(questionControl);
        }
Example #31
0
		private static void LoadProperty(Control control, XmlAttribute attr, PropertyInfo pi, object viewModel)
		{
			object value = attr.Value;

			if (((string)value).StartsWith("{"))
				// If we start with the curly brace, then we're going to try and load a markup extension
				value = LoadMarkupExtension((string)value, control);
			else if (pi.PropertyType.IsEnumOrNullableEnum())
				value = Enum.Parse(pi.PropertyType.GetUnderlyingType(), attr.Value, true);
			else if (pi.PropertyType != Constants.STRING_TYPE)
			{
				// String values don't need to be converted
				var tc = TypeConverters[Constants.STRING_TYPE].FirstOrDefault(t => t.CanConvert(Constants.STRING_TYPE, pi.PropertyType));
				if (tc != null)
					value = tc.ConvertTo(value);
				else
				{
					// This is probably just converting between primitive types (or we're missing a type converter)

					// We need to handle nullable types as well
					var t = pi.PropertyType;
					t = Nullable.GetUnderlyingType(t) ?? t;

					// Coalesce to set the safe value using the default of t or the safe type.
					value = value == null ? t.Default() : Convert.ChangeType(value, t);
				}
			}

			if (value is Binding)
				control.SetBinding(control.GetDependencyProperty(attr.LocalName), value as Binding);
			else
				pi.SetValue(control, value, null);
		}