InternalSetText() 개인적인 메소드

private InternalSetText ( double newValue ) : void
newValue double
리턴 void
예제 #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);
            }
        }
예제 #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);
        }
예제 #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);
            }
        }
예제 #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);
            }
        }