diff --git a/src/Ursa/Controls/TimeBox.cs b/src/Ursa/Controls/TimeBox.cs index 60eccfd..88b482b 100644 --- a/src/Ursa/Controls/TimeBox.cs +++ b/src/Ursa/Controls/TimeBox.cs @@ -320,7 +320,7 @@ public class TimeBox : TemplatedControl } _currentActiveSectionIndex = i; - + if (e.ClickCount == 2) { EnterSection(_currentActiveSectionIndex.Value); @@ -332,7 +332,7 @@ public class TimeBox : TemplatedControl MoveCaret(_currentActiveSectionIndex.Value); } } - + e.Pointer.Capture(_presenters[_currentActiveSectionIndex.Value]); e.Handled = true; } @@ -482,13 +482,16 @@ public class TimeBox : TemplatedControl if (AllowDrag) _dragPanels[index].IsVisible = false; - _presenters[index].ShowCaret(); - _isShowedCaret[index] = true; + ShowCaretInteral(index); _presenters[index].SelectAll(); } private void MoveCaret(int index) { + if (!_isShowedCaret[index]) + { + ShowCaretInteral(index); + } _presenters[index].ClearSelection(); var caretPosition = _pressedPosition.WithX(_pressedPosition.X - _borders[index].Bounds.X); @@ -505,8 +508,7 @@ public class TimeBox : TemplatedControl _presenters[index].ClearSelection(); if (_isShowedCaret[index]) { - _presenters[index].HideCaret(); - _isShowedCaret[index] = false; + HideCaretInteral(index); } if (AllowDrag) @@ -696,4 +698,16 @@ public class TimeBox : TemplatedControl return milliSecond; } + + private void ShowCaretInteral(int index) + { + _presenters[index].ShowCaret(); + _isShowedCaret[index] = true; + } + + private void HideCaretInteral(int index) + { + _presenters[index].HideCaret(); + _isShowedCaret[index] = false; + } } \ No newline at end of file