Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable the vertical scroll-behavior of the scrollviewer in windows phone

I am using a scrollviewer to show some buttons displayed horizontally, I can use the scrollviewer to scroll from left to right, and visa versa. But the user can still drag and scroll downward, though the scrollViewer wil scroll back to the top automatically. This provides a bad UX, thus I want to disable the vertical scroll-behavior of the scrollviewer, user can just scroll horizontally. any thoughts? thanks.

<ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Hidden" Width="auto" Height="100" Margin="0,12" VerticalAlignment="Bottom">
   <StackPanel Orientation="Horizontal">
                    <Button Height="100" Width="100" Margin="0" Style="{StaticResource ButtonStyle}" Click="Origin_Click">
                    </Button>
<Button Height="100" Width="100" Margin="0" Style="{StaticResource ButtonStyle}" Click="Origin_Click">
                    </Button>
<Button Height="100" Width="100" Margin="0" Style="{StaticResource ButtonStyle}" Click="Origin_Click">
                    </Button>
</StackPanel>    
            </ScrollViewer>

v

like image 420
ellic Avatar asked Feb 27 '12 03:02

ellic


1 Answers

Use VerticalScrollBarVisibility="disabled"

like image 92
Shashi Avatar answered Sep 30 '22 16:09

Shashi