diff --git a/MainPage.xaml.cs b/MainPage.xaml.cs index 41c683a..0f406d2 100644 --- a/MainPage.xaml.cs +++ b/MainPage.xaml.cs @@ -242,7 +242,7 @@ public partial class MainPage : ContentPage, INotifyPropertyChanged _isLeftPanelActive = false; System.Diagnostics.Debug.WriteLine($"R !!! {_rightSelectedIndex} {_lastRightSelectedIndex}"); - if (_rightSelectedIndex < RightItems.Count && _rightSelectedIndex >= 0) + if (_lastRightSelectedIndex < RightItems.Count && _lastRightSelectedIndex >= 0) { // Автоматически переключаем фокус при достижении границ if (_rightSelectedIndex > _lastRightSelectedIndex) @@ -289,8 +289,8 @@ public partial class MainPage : ContentPage, INotifyPropertyChanged private void SetFocusToItem(CollectionView collectionView, FileSystemItem item) { // Используем Dispatcher чтобы дождаться рендеринга - //Dispatcher.Dispatch(() => - //{ + Dispatcher.Dispatch(() => + { var container = FindButtonContainer(collectionView, item); if (container is Button button) { @@ -311,7 +311,7 @@ public partial class MainPage : ContentPage, INotifyPropertyChanged // Прокручиваем к выбранному элементу collectionView.ScrollTo(item, position: ScrollToPosition.MakeVisible, animate: false); } - //}); + }); } private Button? FindButtonContainer(CollectionView collectionView, FileSystemItem item)