mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 04:37:30 +02:00
reset scrollviewer on page change (#8742)
This commit is contained in:
committed by
GitHub
parent
b590437ca1
commit
4958f6c158
@@ -27,7 +27,8 @@
|
|||||||
IsSettingsVisible="False"
|
IsSettingsVisible="False"
|
||||||
OpenPaneLength="296"
|
OpenPaneLength="296"
|
||||||
CompactModeThresholdWidth="0"
|
CompactModeThresholdWidth="0"
|
||||||
Background="{ThemeResource SystemControlBackgroundAltHighBrush}">
|
Background="{ThemeResource SystemControlBackgroundAltHighBrush}"
|
||||||
|
SelectionChanged="NavigationView_SelectionChanged">
|
||||||
<winui:NavigationView.MenuItems>
|
<winui:NavigationView.MenuItems>
|
||||||
<winui:NavigationViewItem x:Uid="Shell_General" helpers:NavHelper.NavigateTo="views:GeneralPage" AutomationProperties.HeadingLevel="Level1">
|
<winui:NavigationViewItem x:Uid="Shell_General" helpers:NavHelper.NavigateTo="views:GeneralPage" AutomationProperties.HeadingLevel="Level1">
|
||||||
<winui:NavigationViewItem.Icon>
|
<winui:NavigationViewItem.Icon>
|
||||||
@@ -103,7 +104,8 @@
|
|||||||
<ic:InvokeCommandAction Command="{x:Bind ViewModel.ItemInvokedCommand}" />
|
<ic:InvokeCommandAction Command="{x:Bind ViewModel.ItemInvokedCommand}" />
|
||||||
</ic:EventTriggerBehavior>
|
</ic:EventTriggerBehavior>
|
||||||
</i:Interaction.Behaviors>
|
</i:Interaction.Behaviors>
|
||||||
<ScrollViewer Grid.Column="0">
|
<ScrollViewer x:Name="scrollViewer"
|
||||||
|
Grid.Column="0">
|
||||||
<Grid Margin="{StaticResource MediumLeftRightBottomMargin}">
|
<Grid Margin="{StaticResource MediumLeftRightBottomMargin}">
|
||||||
<Frame x:Name="shellFrame" />
|
<Frame x:Name="shellFrame" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -2,9 +2,8 @@
|
|||||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||||
// See the LICENSE file in the project root for more information.
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Microsoft.PowerToys.Settings.UI.Library;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
||||||
using Windows.Data.Json;
|
using Windows.Data.Json;
|
||||||
using Windows.UI.Xaml.Controls;
|
using Windows.UI.Xaml.Controls;
|
||||||
@@ -129,5 +128,11 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
|||||||
{
|
{
|
||||||
shellFrame.Navigate(typeof(GeneralPage));
|
shellFrame.Navigate(typeof(GeneralPage));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SuppressMessage("Usage", "CA1801:Review unused parameters", Justification = "Params are required for event handler signature requirements.")]
|
||||||
|
private void NavigationView_SelectionChanged(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewSelectionChangedEventArgs args)
|
||||||
|
{
|
||||||
|
scrollViewer.ChangeView(null, 0, null, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user