0

我在 xaml 中尝试了一个简单的 ScrollViewer,如下所示:

<ScrollViewer Height="{Binding RelativeSource={RelativeSource FindAncestor, 
     AncestorType={x:Type StackPanel}}, Path=Height}" ScrollViewer.VerticalScrollBarVisibility="Visible" CanContentScroll="True">
         <DockPanel>
             <StackPanel Name="StackPanel1" OverridesDefaultStyle="False" Width="230" Height="803"
                 VerticalAlignment="Top" HorizontalAlignment="Left" Margin="23,1,0,0">
             ....Something here
             ....Something here
             ....Something here
             </StackPanel>
         </DockPanel>
</ScrollViewer>

但我的问题是..我们是否有可能像使用 WPF 的任何 android 或 iphone 一样创建任何平滑滚动?

有任何想法吗?

4

1 回答 1

0

您需要自己处理 MouseDown、MouseUp、MouseMove 事件,或者我想自己处理适当的触摸事件。

顺便说一句,你为什么使用 relativeSource 来获取父级的高度。你不能只设置滚动查看器来填充父级吗?

于 2012-07-09T03:11:42.767 回答