Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7630627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:09:01+00:00 2026-05-31T06:09:01+00:00

Windows Phone 7. I have a ScrollViewer inside a StackPanel inside a PivotItem inside

  • 0

Windows Phone 7. I have a ScrollViewer inside a StackPanel inside a PivotItem inside a Pivot. Above the ScrollViewer, there are some other controls. My intention is that the ScrollViewer takes the available lower part of the screen (~400px), and its content is scrolled vertically (content height ~800px).

Now, right now there’s no vertical scrolling – when I try to drag, the view returns in the previous position, as if the viewport size exactly matches the content size. When I look at the ViewportHeight property, it’s ~800px – same as content.

Height of the ScrollViewer is not set (“Auto”); I was assuming it would take exactly the available space. That’s obviously not the case. Question – short of setting Height by hand, is there a way to implement the logic of “viewport height is exactly how much vertical space you’ve got left”?

EDIT: here’s the XAML, irrelevant details removed:

<Pivot x:Name="Root">
    <ctls:PivotItem>
        <ctls:PivotItem.Header>Title</ctls:PivotItem.Header>
        <StackPanel>

            <!-- More stuff here-->

            <ScrollViewer Name="MenuPanel" HorizontalScrollBarVisibility="Disabled">
                    <Canvas x:Name="Menu" HorizontalAlignment="Left" VerticalAlignment="Top">
                     </Canvas>
            </ScrollViewer>
        </StackPanel>
    </ctls:PivotItem>
</Pivot>

Width and height of the canvas are set in code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T06:09:02+00:00Added an answer on May 31, 2026 at 6:09 am

    Two things:

    1. A StackPanel doesn’t allow it’s children to automatically take up the rest of the space available. Use a Grid, instead, with defined Rows. This allows your ScrollViewer to be in a container which is the exact height remaining vertically.
    2. Your Canvas (inside the ScrollViewer) is aligned to top and left, and without a size defined, is exactly 0 pixels high and 0 pixels wide.

    Good luck.

    <Pivot x:Name="Root"> 
        <ctls:PivotItem> 
            <ctls:PivotItem.Header>Title</ctls:PivotItem.Header> 
            <Grid> 
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
    
                <Grid Grid.Row="0">
                    <!-- More stuff here--> 
                </Grid>
    
                <ScrollViewer 
                    Grid.Row="1" 
                    Name="MenuPanel">
    
                        <Canvas x:Name="Menu" 
                              Height="500" 
                              Width="500"/>
    
                </ScrollViewer> 
            </StackPanel> 
        </ctls:PivotItem> 
    </Pivot> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Some controls in Windows Phone 7 have touchable area around, if you touch not
I have a Windows Phone application I am developing that needs to persist some
I have a Windows Phone 7 Application. I have one stackpanel control that hosts
I have some Windows Phone 7 code that starts playing a sound using SoundEffect.FromStream.
I have a pivot windows phone 7 app on which there is a bing
Say you have a Windows Mobile 6.0 phone that also has a GPS receiver.
I have a Windows Phone 7 app that has a space in the name.
i have a windows phone silverlight grid that is quite big, around 4 x
In a Windows Phone project I have the following scenario: The user types some
i have a windows phone 7 app that communicates with a web service. i've

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.