locked
Panorama Item not scrolling RRS feed

  • Question

  • Trying to scroll through my Panorama Item but it won't allow me to do so. Does anyone know why? Here is my code:

                <controls:PanoramaItem>

                    <controls:PanoramaItem.Header>

                        <StackPanel>

                            <TextBlock Text="transport"/>

                            <TextBlock Text="connections"/>

                        </StackPanel>

                    </controls:PanoramaItem.Header>

                    <Grid Height="430" ScrollViewer.VerticalScrollBarVisibility="Auto">

                        <StackPanel>

                            <StackPanel>

                                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="London Buses" VerticalAlignment="Top" Width="420" TextAlignment="Center" Foreground="#FFCC3333"/>

                            </StackPanel>

                            <ListBox Margin="0,0,0,20" ScrollViewer.VerticalScrollBarVisibility="Disabled">

                                <ListBox.ItemsPanel>

                                    <ItemsPanelTemplate>

                                        <toolkit:WrapPanel ItemWidth="100"/>

                                    </ItemsPanelTemplate>

                                </ListBox.ItemsPanel>

                                </ListBoxItem>

                                <ListBoxItem>

                                    <StackPanel>

                                        <TextBlock Text="23" Style="{StaticResource PhoneTextLargeStyle}" Foreground="#FF3131F5"/>

                                    </StackPanel>

                                </ListBoxItem>

                                <ListBoxItem>

                                    <StackPanel>

                                        <TextBlock Text="N207" Style="{StaticResource PhoneTextLargeStyle}" Foreground="#FF3131F5"/>

                                    </StackPanel>

                                </ListBoxItem>

                            </ListBox>

                                <StackPanel>

                                    <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Nearest Cycle Hire docking station" VerticalAlignment="Top" Width="420" TextAlignment="Center" Foreground="#0099CC"/>

                                </StackPanel>

                                <StackPanel>

                                    <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Little Argyle Street" Style="{StaticResource PhoneTextLargeStyle}"/>

                                </StackPanel>

                        </StackPanel>

                    </Grid>

                </controls:PanoramaItem>

     
    Tuesday, April 16, 2013 7:11 PM

Answers

  • Instead of <Grid> element, use <ScrollViewer> element.

    Toni Petrina
    My blog: Toni codes .NET
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful"

    • Marked as answer by m.findlay93 Friday, April 19, 2013 2:48 PM
    Wednesday, April 17, 2013 8:14 PM

All replies

  • Anyone?
    Wednesday, April 17, 2013 8:55 AM
  • It won't scroll left-right or up-down?

    Toni Petrina
    My blog: Toni codes .NET
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful"

    Wednesday, April 17, 2013 9:18 AM
  • It won't scroll up-down
    Wednesday, April 17, 2013 11:59 AM
  • You disabled scrolling for ListBox and no other control has anything to scroll. Instead of putting everything inside a Grid, replace Grid with ScrollViewer.

    Toni Petrina
    My blog: Toni codes .NET
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful"

    Wednesday, April 17, 2013 12:54 PM
  • Can this be done via code?
    Wednesday, April 17, 2013 2:44 PM
  • Which part should be changed by code? Why can't you edit the XAML directly?

    Or, if you are already generating the above XAML, simply create ScrollViewer instead of Grid.


    Toni Petrina
    My blog: Toni codes .NET
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful"

    Wednesday, April 17, 2013 3:50 PM
  • I meant XAML
    Wednesday, April 17, 2013 8:01 PM
  • Instead of <Grid> element, use <ScrollViewer> element.

    Toni Petrina
    My blog: Toni codes .NET
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful"

    • Marked as answer by m.findlay93 Friday, April 19, 2013 2:48 PM
    Wednesday, April 17, 2013 8:14 PM
  • OK changed it as necessary and it worked. Thanks again Toni.
    Friday, April 19, 2013 12:53 PM