perf: 纵向丝滑

This commit is contained in:
枫雨
2023-04-18 22:28:05 +08:00
parent 26e4123bc0
commit f2b6328b97
6 changed files with 24 additions and 13 deletions

View File

@@ -118,9 +118,10 @@
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ScrollViewer
<hc:ScrollViewer
Width="360"
Margin="0,10"
IsInertiaEnabled="True"
properties:AutoScroll.AutoScroll="True"
HorizontalScrollBarVisibility="Disabled">
<ItemsControl ItemsSource="{Binding Path=LogItemViewModels}">
@@ -138,7 +139,7 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</hc:ScrollViewer>
<StackPanel
Grid.Row="1"
HorizontalAlignment="Center"

View File

@@ -11,6 +11,7 @@
xmlns:ui="clr-namespace:MaaWpfGui.ViewModels.UI"
xmlns:viewModels="clr-namespace:MaaWpfGui.ViewModels"
xmlns:vm="clr-namespace:MaaWpfGui"
xmlns:hc="https://handyorg.github.io/handycontrol"
d:DataContext="{d:DesignInstance {x:Type ui:RecognizerViewModel}}"
d:DesignHeight="1200"
d:DesignWidth="800"
@@ -41,9 +42,10 @@
<RowDefinition Height="*" />
<RowDefinition Height="150" />
</Grid.RowDefinitions>
<ScrollViewer
<hc:ScrollViewer
Grid.Row="0"
Margin="10,0"
IsInertiaEnabled="True"
VerticalAlignment="Top">
<StackPanel>
<controls:TextBlock
@@ -62,7 +64,7 @@
Text="{Binding RecruitResult}"
TextWrapping="Wrap" />
</StackPanel>
</ScrollViewer>
</hc:ScrollViewer>
<StackPanel
Grid.Row="1"
Margin="27,0"
@@ -130,9 +132,10 @@
<RowDefinition Height="*" />
<RowDefinition Height="150" />
</Grid.RowDefinitions>
<ScrollViewer
<hc:ScrollViewer
Grid.Row="0"
Margin="10,0"
IsInertiaEnabled="True"
VerticalAlignment="Top">
<StackPanel>
<controls:TextBlock
@@ -151,7 +154,7 @@
Text="{Binding DepotResult}"
TextWrapping="Wrap" />
</StackPanel>
</ScrollViewer>
</hc:ScrollViewer>
<StackPanel
Grid.Row="1"
Margin="27,0"

View File

@@ -15,6 +15,7 @@
xmlns:styles="clr-namespace:MaaWpfGui.Styles"
xmlns:properties="clr-namespace:MaaWpfGui.Styles.Properties"
xmlns:controls="clr-namespace:MaaWpfGui.Styles.Controls"
xmlns:hc="https://handyorg.github.io/handycontrol"
d:DataContext="{d:DesignInstance {x:Type ui:SettingsViewModel}}"
d:DesignHeight="3000"
d:DesignWidth="800"
@@ -32,9 +33,10 @@
ItemsSource="{Binding ListTitle}"
SelectedIndex="{Binding SelectedIndex}" />
<ScrollViewer
<hc:ScrollViewer
Grid.Column="1"
Margin="20,10"
IsInertiaEnabled="True"
HorizontalAlignment="Stretch"
properties:ScrollViewerBinding.ExtentHeight="{Binding ScrollExtentHeight}"
properties:ScrollViewerBinding.RectangleVerticalOffsetList="{Binding RectangleVerticalOffsetList}"
@@ -207,6 +209,6 @@
<userControl:AboutUserControl Margin="20" HorizontalAlignment="Center" />
<!--<Rectangle HorizontalAlignment="Stretch" Fill="{DynamicResource BorderBrush}" Height="1" />-->
</StackPanel>
</ScrollViewer>
</hc:ScrollViewer>
</Grid>
</UserControl>

View File

@@ -187,9 +187,10 @@
<!--<GridSplitter Grid.Column="2" Width="5" HorizontalAlignment="Stretch" />-->
<!--<Rectangle Grid.Column="2" VerticalAlignment="Stretch" Fill="{DynamicResource BorderBrush}" Width="4" />-->
<ScrollViewer
<hc:ScrollViewer
Grid.Column="2"
Margin="10"
IsInertiaEnabled="True"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
properties:AutoScroll.AutoScroll="True"
@@ -220,6 +221,6 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</hc:ScrollViewer>
</Grid>
</UserControl>

View File

@@ -57,7 +57,10 @@
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
Focusable="False">
<ScrollViewer x:Name="PART_ContentHost" />
<hc:ScrollViewer
x:Name="PART_ContentHost"
IsInertiaEnabled="True"/>
</Border>
</ControlTemplate>
</FlowDocumentScrollViewer.Template>

View File

@@ -16,7 +16,8 @@
d:DataContext="{d:DesignInstance {x:Type ui:TaskQueueViewModel}}"
d:DesignWidth="250"
mc:Ignorable="d">
<ScrollViewer>
<hc:ScrollViewer
IsInertiaEnabled="True">
<Grid Width="220" Margin="0,0,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -294,5 +295,5 @@
</StackPanel>
</Grid>
</Grid>
</ScrollViewer>
</hc:ScrollViewer>
</UserControl>