Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/Files.App.Controls/BladeView/BladeView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,17 @@ private ScrollViewer GetScrollViewer()
return _scrollViewer ?? (_scrollViewer = this.FindDescendant<ScrollViewer>());
}

public void ScrollToEnd()
{
LayoutUpdated += OnLayoutUpdatedScrollToEnd;
}

private void OnLayoutUpdatedScrollToEnd(object sender, object e)
{
LayoutUpdated -= OnLayoutUpdatedScrollToEnd;
GetScrollViewer()?.ChangeView(_scrollViewer.ScrollableWidth, null, null, false);
}

private void AdjustBladeItemSize()
{
// Adjust blade items to be full screen
Expand Down Expand Up @@ -182,7 +193,8 @@ private void ItemsVectorChanged(IObservableVector<object> sender, IVectorChanged
else if (e.CollectionChange == CollectionChange.ItemInserted)
{
UpdateLayout();
GetScrollViewer()?.ChangeView(_scrollViewer.ScrollableWidth, null, null);
// The following line doesn't work as expected due to the items not being fully loaded yet and thus the scrollable width not being accurate.
//GetScrollViewer()?.ChangeView(_scrollViewer.ScrollableWidth, null, null);
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/Files.App/Views/Layouts/ColumnsLayoutPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ public void SetWidth(int index)

var blade = activeBlades[index];
blade?.SetWidth();

ColumnHost.ScrollToEnd();
}

private void ContentChanged(IShellPage p)
Expand Down