Search code examples
windowsmicrosoft-metrowinrt-xamlmodern-runtime

Detecting and Implementing Scrollbar Style in Window 8/RT Application


I am developing a Custom Control to be placed inside a ScrollViewer, I have Custom coded a generic.xaml for applying visual style for the Scrollviewer.

                        <ScrollBar x:Name="VerticalScrollBar"
                                   Grid.Row="0"
                                   Grid.Column="1"
                                   Width="18"
                                   Margin="0,-1,-1,-1"
                                   IndicatorMode="TouchIndicator"
                                   IsTabStop="False"
                                   Maximum="{TemplateBinding ScrollableHeight}"

The Problem I am facing is, I need to set the IndicatorMode to TouchIndicator/MouseIndicator based on whether the user is using Touch Devices or not. Is there a way to do it?

Thanks

Arun Selva Kumar. B


Solution

  • Used Visual State Manager to achieve the requirement.