HorizontalScrollViewerStyle and VerticalScrollViewerStyle for Windows apps

Back in the days when Windows Store 8.0 was shipped Microsoft bundled a nice set of standard styles in the file StandardStyles.xaml. While I never used most included styles there was two styles I used repeatedly through out almost all projects and that was HorizontalScrollViewerStyle and VerticalScrollViewerStyle.

The benefits of the two styles was that they disabled all the properties you would expect to be disabled. With the styles your scrollviewer disables zoom and only scrolls the appropriate direction. 

HorizontalScrollViewerStyle

 <Style
        x:Key="HorizontalScrollViewerStyle"
        TargetType="ScrollViewer">
        <Setter
            Property="HorizontalScrollBarVisibility"
            Value="Auto" />
        <Setter
            Property="VerticalScrollBarVisibility"
            Value="Disabled" />
        <Setter
            Property="ScrollViewer.HorizontalScrollMode"
            Value="Enabled" />
        <Setter
            Property="ScrollViewer.VerticalScrollMode"
            Value="Disabled" />
        <Setter
            Property="ScrollViewer.ZoomMode"
            Value="Disabled" />
    </Style>


VerticalScrollViewerStyle

    <Style
        x:Key="VerticalScrollViewerStyle"
        TargetType="ScrollViewer">
        <Setter
            Property="HorizontalScrollBarVisibility"
            Value="Disabled" />
        <Setter
            Property="VerticalScrollBarVisibility"
            Value="Auto" />
        <Setter
            Property="ScrollViewer.HorizontalScrollMode"
            Value="Disabled" />
        <Setter
            Property="ScrollViewer.VerticalScrollMode"
            Value="Enabled" />
        <Setter
            Property="ScrollViewer.ZoomMode"
            Value="Disabled" />
    </Style>

Feel free to let me know in the comments if you have any comments or improvements to the code above.

P.S Make sure you follow me on twitter @deanihansen for more news, design tips, articles and how-to's.