InternalSetText() private method

private InternalSetText ( double newValue ) : void
newValue double
return void
Ejemplo n.º 1
0
        private static void OnStringFormatChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            NumericUpDown nud = (NumericUpDown)d;

            nud.SetRemoveStringFormatFromText((string)e.NewValue);
            if (nud._valueTextBox != null &&
                nud.Value.HasValue)
            {
                nud.InternalSetText(nud.Value);
            }
        }
Ejemplo n.º 2
0
        private static void OnStringFormatChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            NumericUpDown numericUpDown = (NumericUpDown)d;

            numericUpDown.SetRemoveStringFormatFromText((string)e.NewValue);
            if (numericUpDown._valueTextBox != null && numericUpDown.Value.HasValue)
            {
                numericUpDown.InternalSetText(numericUpDown.Value);
            }
            numericUpDown.HasDecimals = !NumericUpDown.RegexStringFormatHexadecimal.IsMatch((string)e.NewValue);
        }
Ejemplo n.º 3
0
        private static void OnStringFormatChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            NumericUpDown nud = (NumericUpDown)d;

            nud.SetRemoveStringFormatFromText((string)e.NewValue);
            if (nud._valueTextBox != null &&
                nud.Value.HasValue)
            {
                nud.InternalSetText(nud.Value);
            }

            if (!nud.HasDecimals && RegexStringFormatHexadecimal.IsMatch((string)e.NewValue))
            {
                nud.SetCurrentValue(HasDecimalsProperty, true);
            }
        }
Ejemplo n.º 4
0
        private static void OnStringFormatChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            NumericUpDown nud = (NumericUpDown)d;

            if (nud._valueTextBox != null && nud.Value.HasValue)
            {
                nud.InternalSetText(nud.Value);
            }

            var value = (string)e.NewValue;

            if (!nud.NumericInputMode.HasFlag(NumericInput.Decimal) && !string.IsNullOrEmpty(value) && RegexStringFormatHexadecimal.IsMatch(value))
            {
                nud.SetCurrentValue(NumericInputModeProperty, nud.NumericInputMode | NumericInput.Decimal);
            }
        }