当鼠标继续工作时,WPF应用程序停止响应触摸 [英] WPF Apps stop responding to touches while mouse continues to work

查看:111
本文介绍了当鼠标继续工作时,WPF应用程序停止响应触摸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

WPF应用程序在一段时间后停止响应触摸屏(我们使用简单的按钮单击事件)(不一致)但会响应鼠标点击而非WPF应用程序(资源管理器等)继续回复触摸很好。


因为非WPF应用程序响应,你可能会排除触摸屏驱动程序。


非常 类似 到这篇文章:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/0edc6c2c-f869-4e76-b207-5b2d21078a7f/touch-stop-working


...除了我们没有使用SurfaceWindow或'Surface SDK',我们使用的是HP Touchsmart计算机。 我们使用.NET 4.5(Visual Studio 2012)运行Windows 7 64位。


我想知道微软是否将SurfaceWindow和Window代码融合在一起?


快速更新:我们通过在设备管理器中禁用触摸屏并重新启用它来重现我们的应用程序的问题。  WPF应用程序之后无法响应触摸,系统的其余部分仍在响应触摸。


这是一个简单的MainWindow,您可以在示例应用程序中使用它来演示此问题:


公共部分类MainWindow

    {

        public MainWindow()

        {

            InitializeComponent();

            this.Topmost = true; //需要显示问题

        }


        private void Button_Click(object sender,RoutedEventArgs e)

        {

            MessageBox.Show(" Click!");

        }
    }


 和XAML:


< Window x:Class =" TestTouchscreenApp.MainWindow" b $ b        xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation " ;
$
        xmlns:x =" http://schemas.microsoft.com/winfx/2006/xaml "

       标题= QUOT;主窗口"高度= QUOT; 350"宽度="525">

    <网格>

        < Button Content =" Button"的Horizo​​ntalAlignment = QUOT;左"余量= QUOT; 142,62,0,0" VerticalAlignment = QUOT;陀螺"宽度= QUOT; 178"高度= QUOT; 88"点击=" Button_Click" />


    < / Grid>

< / Window>




解决方案

华法林,



我正在努力涉及在这个主题上有更多经验的人。请耐心等待,我们会尽快给您提供更多信息。
感谢您的理解!


此致


WPF applications stop responding to the touchscreen (we are using simple button click events) after some period of time (not consistent) but WILL respond to mouse clicks and the non-WPF applications (explorer, etc) continue to respond to touch just fine.

Because the non-WPF applications respond you can likely rule out the touchscreen drivers.

Very similar to this post: http://social.msdn.microsoft.com/Forums/vstudio/en-US/0edc6c2c-f869-4e76-b207-5b2d21078a7f/touch-stop-working

...except that we are not using a SurfaceWindow nor the 'Surface SDK' and we are using an HP Touchsmart computer.  We are running Windows 7 64 bit using .NET 4.5 (Visual Studio 2012).

I wonder if Microsoft melded the SurfaceWindow and Window code together at some point?

Quick Update: We reproduced the issue with our application by disabling the touchscreen in Device Manager and re-enabling it.  WPF application failed to respond to touches afterwards and the rest of the system was still responding to touches.

And here's a simple MainWindow that you can use in a sample app that will demonstrate the issue:

public partial class MainWindow
    {
        public MainWindow()
        {
            InitializeComponent();
            this.Topmost = true; //required to display the problem
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("Click!");
        }
    }

  And the XAML:

<Window x:Class="TestTouchscreenApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Button Content="Button" HorizontalAlignment="Left" Margin="142,62,0,0" VerticalAlignment="Top" Width="178" Height="88" Click="Button_Click"/>

    </Grid>
</Window>


解决方案

Hi Warfarin,

I am trying to involve people who have more experience on this topic. Please be patient, we will back to give you more information soon when get further process on it.
Thanks for your understanding!

Regards,


这篇关于当鼠标继续工作时,WPF应用程序停止响应触摸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆