0

Within a WP7 app I am generating a Scrollviewer within the code. This Scrollviewer has a StackPanel as its content and within the Stackpanel I have a grid. I have not assigned any specific heights to these controls.

As far as the look and the behaviour I am after, all is fine.

I now want to position the scrollviewer to a certain point - after I have generated it and its children.

It seems that the ScrollViewer.ScrollToVerticalOffset method is what I should be using. But I cannot ascertain the height of the Scrollviewer... both Height and ActualHeight are returning 0. I want to use this height to determine which point I should be scrolling to.

And even when I hardcode a ScrollToVerticalOffet value then it still doesn't reposition itself.

Is there a way that I can get this to position as I want, and how can I determine the height values?

  • thanks
Peter
  • 679
  • 1
  • 10
  • 25

1 Answers1

0

Got it working ok when I checked for values in the Page loaded event... and the ScrolltoOffset seemed to work fine there too.

Peter
  • 679
  • 1
  • 10
  • 25