Repository navigation
Closed
Description
feature proposal
Make the GotoTop support the ListView. That would be great.
Additional context
Many control in the generic.xaml didn't expose their ScrollVier(er) directly in the xaml such as https://github.com/microsoft/microsoft-ui-xaml/blob/354bf6017e6443023214d34309dfdf0fe2d526b1/dxaml/xcp/dxaml/themes/generic_perf2026.xaml#L9447-L9551 , which we can't set the <Setter Property="ScrollViewer.Name" Value=""/> in the xaml too and causes a series of troubles. But we still can get the internal control by VisualTreeHelper.GetChild. So we may chage the
DevWinUI/dev/DevWinUI/Controls/Native/Others/GotoTop.cs
Lines 67 to 106 in 10577a1
| public virtual void CreateGotoAction(DependencyObject obj) | |
| { | |
| if (_scrollViewer != null) | |
| { | |
| _scrollViewer.ViewChanged -= ScrollViewer_ViewChanged; | |
| } | |
| if (_scrollView != null) | |
| { | |
| _scrollView.ViewChanged -= ScrollView_ViewChanged; | |
| } | |
| if (obj is ScrollViewer viewer && viewer != null) | |
| { | |
| _scrollViewer = viewer; | |
| _scrollViewer.ViewChanged += ScrollViewer_ViewChanged; | |
| if (Animated) | |
| { | |
| _gotoTopAction = () => _scrollViewer.ChangeView(null, 0, null, false); | |
| } | |
| else | |
| { | |
| _gotoTopAction = () => _scrollViewer.ChangeView(null, 0, null, true); | |
| } | |
| } | |
| else if (obj is ScrollView view && view != null) | |
| { | |
| _scrollView = view; | |
| _scrollView.ViewChanged += ScrollView_ViewChanged; | |
| if (Animated) | |
| { | |
| _gotoTopAction = () => _scrollView?.ScrollTo(0, 0, new ScrollingScrollOptions(ScrollingAnimationMode.Auto)); | |
| } | |
| else | |
| { | |
| _gotoTopAction = () => _scrollView?.ScrollTo(0, 0, new ScrollingScrollOptions(ScrollingAnimationMode.Disabled)); | |
| } | |
| } | |
| } |
I'm waitting for your idea.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Enhance page navigation and launch UI
fix ghost1372#235
Enhance page navigation and launch UI
Enhance page navigation and launch UI