none
What's causing touch input to be ignored in my WPF app after rotating my Samsung tablet? RRS feed

  • Question

  • I have a WPF app that I'm testing on a Samsung XE700T1A tablet. I have no other tablets to test it on. Upon launching the app, when I rotate the tablet to portrait mode, my UI elements stop responding to touch. They continue to ignore touch after rotating back to landscape again, but then after rotating a third time back to portrait, touch works. Further rotations seem to have indeterminate results. Sometimes touch works, sometimes you have to keep rotating to get it back. I have seen an occasional variation in that initial sequence, but for the most part it appears very consistent.

    In order to narrow down the range of possibilities, I created a simple WPF app to demonstrate the issue. Here is the code:

    MainWindow.xaml

    <Window x:Class="RotationBug.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow">
    
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
    
            <TextBlock x:Name="DisplayText" 
                       HorizontalAlignment="Center" 
                       VerticalAlignment="Center"
                       Text="I'm happy." />
    
            <Button Grid.Row="1" 
                    Height="22" 
                    Width="80" 
                    Margin="0,0,0,20" 
                    Click="OnButtonPress"
                    Content="Depress Me" />
        </Grid>
    </Window>
    


    MainWindow.xaml.cs

    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
    
        private void OnButtonPress(object sender, RoutedEventArgs e)
        {
            DisplayText.Text = DateTime.UtcNow.Ticks.ToString();
        }
    }
    


    This simple demo app is also hosted here on GitHub.

    Does anyone know what is causing this issue? Or how to resolve it? Can anyone reproduce this issue?

    Thursday, January 5, 2012 10:01 PM

Answers

  • Hi Eben,

    For WPF issues you'll be better off posting in the WPF forum. I suspect you're running into the known issue described in this thread on that forum.

    --Rob

    • Marked as answer by Eben Geer Wednesday, January 11, 2012 4:50 PM
    Friday, January 6, 2012 12:40 AM

All replies

  • Hi Eben,

    For WPF issues you'll be better off posting in the WPF forum. I suspect you're running into the known issue described in this thread on that forum.

    --Rob

    • Marked as answer by Eben Geer Wednesday, January 11, 2012 4:50 PM
    Friday, January 6, 2012 12:40 AM
  • Thanks Rob. That did end up solving the issue. You say it is a known issue, but if that is the only place on the internet where it is "known" then somebody at MS isn't doing enough to support the developer community. This would appear to be a fundamental issue for any WPF app on a device that can change screen dimensions, most critically, when rotating tablets.

    For anyone else that is experiencing this issue, I have shared my version of a solution (which doesn't use internal MS code that is unavailable to us) here on GitHub.


    • Edited by Eben Geer Wednesday, January 11, 2012 5:13 PM
    Wednesday, January 11, 2012 5:12 PM