I'm developing a Windows Phone 7.1 app and I have a ScrollViewer with an ItemsControl inside it, where each item in the ItemsControl contains two TextBoxes. When the user taps a TextBox on the lower half of the screen to enter a value, the screen usually scrolls up so that the on-screen keyboard doesn't cover up the focused TextBox. However, in my app this only happens about 50% of the time. The other 50%, the keyboard still comes up but the screen doesn't scroll up and the focused TextBox gets covered by the on-screen keyboard.
Since it doesn't always happen and I can't reliably make the problem happen or prevent it, I'm guessing that there's some kind of race condition occurring between 2 threads involving updating the layout or something. Just a guess.
Is there a method I should be calling in the TextBoxes' GotFocus events to ensure that the auto-scrolling when focusing on a TextBox will work? Maybe something similar to this other question's answer?