Click here to Skip to main content
15,886,724 members
Articles / Silverlight
Tip/Trick

Silverlight Smooth Scrolling

Rate me:
Please Sign up or sign in to vote.
4.00/5 (1 vote)
29 Oct 2012CPOL 8.1K   271   2  
Making Scrolling smooth in Silverlight Itempresenter

Introduction

By default, Silverlight Scrollviewer skips the entire item when it comes to scrolling.But we can make it scroll smooth.In various situations, depending upon the User Experience of our Silverlight application, we want to make a smooth move between the items.

Gallery

Using the Code

Microsoft Expression blend sdk has something for you. 

Microsoft.Expression.Interactivity has a FluidMoveBehavior can be easily used inside the listbox control template to achieve the target.

HTML
 <ScrollViewer x:Name="ScrollViewer" BorderBrush="Transparent" BorderThickness="0" 
      Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" 
      TabNavigation="{TemplateBinding TabNavigation}" 
      Style="{StaticResource ListBoxScrollViewerStyle}">
                <ItemsPresenter>
                                    <i:Interaction.Behaviors>
                                        <ei:FluidMoveBehavior x:Name="FluidMoveBehavior"/>
                                    </i:Interaction.Behaviors>
                </ItemsPresenter>
  </ScrollViewer>

To do this we need to add two assemblies Microsoft.Expression.Interactions.dll and System.Windows.Interactivity.dll

To learn more about FluidMoveBehavior visit :

http://msdn.microsoft.com/en-us/library/ff723946(v=expression.40).aspx

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --