0
votes

I have a Windows Phone 8 application (please note that it's not 8.1) and I have the following struggle. I have a page containing a StackPanel. Within the StackPanel there are several objects like buttons, textboxes and a LongListSelector. The LongListSelector is bound to an ItemsSource. Because it can contain a lot of items I had to set the MaxHeight (otherwise it exceeds the limit of 2000px of vertical screen space) However when scrolling the page down I stumble upon the LongListSelector. I can than scroll the LongListSelector too, which is fine. But when I scroll to the end of the LongListSelector it won't 'snap' to the StackPanel so it just leaves the page there and doesn't continue with scrolling to StackPanel.

A short code example:

<StackPanel>
    <Button />
    <TextBlock />
    <TextBox />
    <Button />
    <LongListSelector>
       This contains a bunch of items
    <LongListSelector/>
    <TextBox />
</StackPanel>

So what happends is.. I can scroll the complete page to the LongListSelector. I can scroll the LongListSelector. But when I'm at the end of the LongListSelector.. It wont continu scrolling the page. So I never see the last TextBox (in this example that is)

I've also tried replacing the LongListSelector with a ListBox but that doesn't make any difference.

Hope that someone can help me out here.

1

1 Answers

0
votes

From your Question what I understood is that the total height by summing up your UI Elements is more than the Page Height. If you put a ScrollViewer Tag at the start and End of StackPanel. It will work just fine. In ListBox and LongListSelector it is implied.

<ScrollViewer> <StackPanel> <Button /> <TextBlock /> <TextBox /> <Button /> <LongListSelector> This contains a bunch of items <LongListSelector/> <TextBox /> </StackPanel> </ScrollViewer>