dispatch + fix

main
Stepan Pilipenko 3 weeks ago
parent 06abd87560
commit bad21de73d

@ -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)

Loading…
Cancel
Save