3
votes

I have created a simple test app to replicate a problem I am seeing but cannot work out a solution to. I have a basic Windows Store app with a flat list of TextBoxs contained in an ItemsControl. The list is just long enough that when the Bottom TextBox has focus is it obscured by the Virtual Keyboard and the entire view will automatically scroll up to ensure the TextBox is visible while using the keyboard.

However if the ItemsControl is hosted in a FlipView or GridView rather than a simple Grid as shown below then the Automatic vertical scrolling does not occur and the bottom element remains obscured by the Virtual keyboard. This appears to be due to the fact that the Parent control contains a ScrollViewer which seems to completely override the default helpful view scrolling behavior.

The question is how do I re-enable this behaviour? I have tried removing the ScrollViewer in my own style which works but also means the FlipView no longer functions as a FlipView.

<Grid>
        <ItemsControl Width="200">
            <TextBox Text="Test"></TextBox>
            <TextBox Text="Test"></TextBox>
            <TextBox Text="Test"></TextBox>
            <TextBox Text="Test"></TextBox>
            <TextBox Text="Test"></TextBox>
            <TextBox Text="Test"></TextBox>
            <TextBox Text="Test"></TextBox>
            <TextBox Text="Test"></TextBox>
            <TextBox Text="Test"></TextBox>
            <TextBox Text="Test"></TextBox>
            <TextBox Text="Test"></TextBox>
            <TextBox Text="Test"></TextBox>
            <TextBox Text="Test"></TextBox>
            <TextBox Text="Test"></TextBox>
            <TextBox Text="Test"></TextBox>
            <TextBox Text="Test"></TextBox>                
            <TextBox Text="Hidden by VKD"></TextBox>            
        </ItemsControl>       
</Grid>
2
Have you reported it to Microsoft somewhere?Filip Skakun

2 Answers

1
votes

I had the same issue and found the element that's causing the issue: it is the VirtualizingStackPanel that is used within many ItemsControls as the default Items Panel. If you change this to a normal StackPanel, then the corresponding input control is translated correctly when the virtual keyboard pops up.

Details can be found here: Why is my text box contained in a FlipView obscured by the soft keyboard when it pops up?

-1
votes

Perhaps you could move your TextBox yourself when the keyboard shows up? This sample looks promising:

Responding to the appearance of the on-screen keyboard sample