ServiceBusMQManager.UIControlFactory.InputControl CreateInpuControl() { var ctl = UIControlFactory.CreateControl(null, _type, null); ctl.Control.Margin = new Thickness(0, 4, 50, 0); ctl.Control.Width = this.Width - 40; ctl.Control.Height = 30; ctl.Control.VerticalAlignment = System.Windows.VerticalAlignment.Top; //_currCtl.Control.Height = 25; if (ctl.DataType == DataType.Complex) { var complexCtl = (ctl.Control as ComplexDataInputControl); complexCtl.ShowContentInName = false; complexCtl.DefineComplextType += cd_DefineComplextType; } return(ctl); }
void _CreateValueControl(Type t) { if (_valueControl != null) { RemoveVisualChild(_valueControl); } var controlThickness = new Thickness(180, 0, 0, 0); var input = UIControlFactory.CreateControl(DisplayName, _type, _value); _valueControl = input.Control; _dataType = input.DataType; _isNullable = input.IsNullable; IInputControl ctl = input.Control as IInputControl; ctl.ValueChanged += ctl_ValueChanged; if (_dataType == DataType.Complex) { (_valueControl as ComplexDataInputControl).DefineComplextType += cd_DefineComplextType; } else if (_dataType == DataType.Array) { (_valueControl as ArrayInputControl).DefineComplextType += cd_DefineComplextType; } if (!_isNullable) { rValue.Visibility = System.Windows.Visibility.Hidden; } if (_valueControl != null) { _valueControl.Margin = controlThickness; } theGrid.Children.Add(_valueControl); }