Reputation: 526
How can i prevent scrolling up the background image of the page? The rest content should scrolling like always
Upvotes: 0
Views: 176
Reputation: 21899
You can handle the InputPane.Showing and InputPane.Hiding events to override the content scrolling as you'd like. By default, the InputPane will apply a translation to the entire page to keep the focused control in view, but you can handle this yourself for custom behaviour.
For your case, you can find the space the InputPane will take from the OccludedRect property, do the math to figure out how far (if at all) you need to move the page to keep the focused control visible, and apply a transform to a control container rather than to the entire page. Set the EnsuredFocusedElementInView property to indicate that you did the sliding so the InputPane doesn't do its own.
Another option would be to handle Showing and apply an inverse transform just to the image, but it will be trickier to figure out how far the InputPane moved things than it will be to just move them yourself.
Upvotes: 3