The first thing to do is get a copy of the existing ScrollViewer template. Blend makes it very simple. In VS you have more work. Let's start with the UserControl base
<UserControl ....> <Grid x:Name="LayoutRoot"> <ScrollViewer ...> </ScrollViewer> </Grid> </UserControl>
After you get the ScrollViewer Styles and Templates documentation, you will find the existing xaml for this control here. Copy it and put it in UserControl resources.
<UserControl ....> <UserControl.Resources> <Style x:Key="MyScrollViewerStyle" TargetType="ScrollViewer"> </Style> </UserControl.Resources> <Grid ....> <Grid x:Name="LayoutRoot"> <ScrollViewer Style="{StaticResource MyScrollViewerStyle}"> </ScrollViewer>
ScrollViewer now looks the same as before. The difference is that you can now start playing with the Template Setter in style to ScrollViewer and customize the ScrollViewer .
source share