0

I have trying a simple ScrollViewer in xaml like below:

<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>

But my question is..is it possible for us to create any smooth scrolling likes any android or iphone using WPF?

Any ideas?

jimi
  • 5
  • 6

1 Answers1

0

You would need to handle the MouseDown, MouseUp, MouseMove events yourself or the appropriate touch events yourself I would imagine.

BTW, why are you using a relativeSource to get the height of the parent. Can't you just set the scroll viewer to fill the parent?

MikeKulls
  • 2,979
  • 2
  • 25
  • 30
  • I also planning to start with MouseDown, MouseUp, MouseMove events. Thanks for sharing "MikeKulls". I'm using RelativeSource to control the scroller depends on "Height" for another stackpanel actually. – jimi Jul 09 '12 at 03:21