Exemplo n.º 1
0
        /// <inheritdoc />
        protected override AutomationPeer OnCreateAutomationPeer()
        {
            RadNumericBox parent = ElementTreeHelper.FindVisualAncestor <RadNumericBox>(this);

            if (parent != null)
            {
                return(new NumericTextBoxAutomationPeer(this, parent));
            }
            return(base.OnCreateAutomationPeer());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the value of the control.
        /// </summary>
        /// <param name="value">Sets the value of the control.</param>
        public void SetValue(double value)
        {
            if (!this.IsEnabled())
            {
                throw new ElementNotEnabledException();
            }

            RadNumericBox owner = (RadNumericBox)this.Owner;

            if ((value < owner.Minimum) || (value > owner.Maximum))
            {
                throw new ArgumentOutOfRangeException("value");
            }
            owner.Value = value;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the RadNumericBoxAutomationPeer class.
 /// </summary>
 /// <param name="owner">The RadNumericBox that is associated with this RadNumericBoxAutomationPeer.</param>
 public RadNumericBoxAutomationPeer(RadNumericBox owner)
     : base(owner)
 {
 }
 /// <summary>
 /// Initializes a new instance of the NumericTextBoxAutomationPeer class.
 /// </summary>
 /// <param name="tBox">The TextBox that is associated with this NumericTextBoxAutomationPeer.</param>
 /// <param name="numeric">The RadNumeriBox that is associated with this NumericTextBoxAutomationPeer.</param>
 public NumericTextBoxAutomationPeer(TextBox tBox, RadNumericBox numeric) : base(tBox)
 {
     this.ParentNumericBox = numeric;
 }
Exemplo n.º 5
0
 private void InitNumericBox(RadNumericBox numericBox)
 {
     numericBox.Width = 200;
 }