/// <inheritdoc/>
 protected override void OnGotKeyboardFocus(KeyboardDevice device, IInputElement oldFocus, IInputElement newFocus, RoutedEventData data)
 {
     if (PART_Input != null)
     {
         PART_Input.Focus();
     }
     base.OnGotKeyboardFocus(device, oldFocus, newFocus, data);
 }
 /// <inheritdoc/>
 protected override void OnLostKeyboardFocus(KeyboardDevice device, IInputElement oldFocus, IInputElement newFocus, RoutedEventData data)
 {
     if (PART_Input != null)
     {
         PART_Input.InvalidateDisplayCache(TextBox.TextProperty);
         PART_Input.CaretIndex = 0;
     }
     base.OnLostKeyboardFocus(device, oldFocus, newFocus, data);
 }
 /// <inheritdoc/>
 protected override void OnValueChanged()
 {
     if (PART_Input != null)
     {
         PART_Input.DigestImmediately(TextBox.TextProperty);
         PART_Input.CaretIndex = PART_Input.TextLength;
     }
     base.OnValueChanged();
 }
        /// <summary>
        /// Invalidates the updown's format string.
        /// </summary>
        private void InvalidateFormatString()
        {
            if (PART_Input == null)
            {
                return;
            }

            PART_Input.SetFormatString(TextBox.TextProperty, DecimalPlaces > 0 ?
                                       "0." + new String('0', DecimalPlaces) : "0");
        }