Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Phone: how to disable touch scrolling in ScrollViewer (Listbox)?

i have a scrollviewer with a listbox inside: i need to disable the vertical scroll by touch, how can i? In other words, the user can't scroll with the touch (i have put buttons, but this is another story).

    <ScrollViewer  HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled" x:Name="imagesScrollview" Width="480" Height="595" Margin="0,112,0,63">
        <ScrollViewer.RenderTransform>
            <CompositeTransform/>
        </ScrollViewer.RenderTransform>
        <ListBox Name="listavideo" Height="595" Width="480">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Button Width="470" Height="146" Background="White" BorderBrush="#346699" Click="apri_video" Name="{Binding Mylink}" Margin="5,0,5,0" Padding="5">
                        <Button.Content>
                            <StackPanel Orientation="Horizontal" Width="470">
                                <Image Source="{Binding Thumbnail}" Width="160" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                <StackPanel Orientation="vertical" Width="285" Margin="0,0,0,0" Height="146">
                                    <StackPanel Orientation="Horizontal" Width="275" Margin="0,0,10,0">
                                        <TextBlock Width="275" FontSize="18" Text="{Binding Title}" Foreground="#34638f" TextWrapping="Wrap" />
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" Width="275" Margin="0,0,10,0">
                                        <TextBlock Width="275" FontSize="14" Text="{Binding Description}" Foreground="#51504e" TextWrapping="Wrap" />
                                    </StackPanel>
                                </StackPanel>
                            </StackPanel>
                        </Button.Content>
                    </Button>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </ScrollViewer>

Thanks.

like image 545
Zak Avatar asked Dec 08 '22 22:12

Zak


1 Answers

<ListBox ScrollViewer.VerticalScrollBarVisibility="Disabled" Name="listavideo" Height="595" Width="480" >
    <ListBox.ItemTemplate>
        ...
like image 52
Ku6opr Avatar answered May 06 '23 04:05

Ku6opr