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.

Video: Increase your XAML Productivity with Blend for Visual Studio (1h 27 min)

The 26th of March I held a webtalk online on increasing the XAML productivity with Blend for Visual Studio.

Per request the webtalk was recorded and is now available.

The slides and the source code is available through this link http://sdrv.ms/ZgFMoL

The talk was hosted by the Windows Developers in Denmark usergroup.

Thanks for reading.
I hope you’ll enjoy the video. If you have any comments or feedback feel free to reach out to me in comments or on twitter @deanihansen.

New Expression Blend resource on Channel9

Channel 9's DevRadio, by Jerry Nixon, recently looked at some of the new things with xaml and Expression Blend. Here is one thing you should definitely check out:

Building your Windows 8 Apps with XAML and Blend Navit Saxena and Hari Menon from the Microsoft Blend team to the show as they discuss the latest features and improvements made in Blend as it pertains to XAML developers and its integration with Visual Studio 2012