From 99cae144e4db58d5b27117a9fc17bfb73770132b Mon Sep 17 00:00:00 2001 From: rabbitism Date: Sat, 9 Mar 2024 17:38:51 +0800 Subject: [PATCH] feat: support left right navigation. --- src/Ursa/Controls/VerificationCode/VerificationCode.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Ursa/Controls/VerificationCode/VerificationCode.cs b/src/Ursa/Controls/VerificationCode/VerificationCode.cs index 8253898..5e963bd 100644 --- a/src/Ursa/Controls/VerificationCode/VerificationCode.cs +++ b/src/Ursa/Controls/VerificationCode/VerificationCode.cs @@ -165,5 +165,15 @@ public class VerificationCode: TemplatedControl _currentIndex--; _itemsControl?.ContainerFromIndex(_currentIndex)?.Focus(); } + else if(e.Key == Key.Left && _currentIndex > 0) + { + _currentIndex--; + _itemsControl?.ContainerFromIndex(_currentIndex)?.Focus(); + } + else if(e.Key == Key.Right && _currentIndex < Count) + { + _currentIndex++; + _itemsControl?.ContainerFromIndex(_currentIndex)?.Focus(); + } } } \ No newline at end of file