Surface Pro上的.NET Framework中的空引用Windows 8.1当键盘快照打开或关闭时 [英] Null Reference in .NET Framework on Surface Pro Windows 8.1 When Keyboard Snaps on or off

查看:68
本文介绍了Surface Pro上的.NET Framework中的空引用Windows 8.1当键盘快照打开或关闭时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户取消注意或按住键盘时,我们的应用程序在8.1 Pro出现时开始崩溃。 它只是定期发生但可重复。 据我们所知,这不会发生在8.0上。

Our application started crashing on Surface Pros when 8.1 came out when the user unsnaps or snaps the keyboard.  It only happens periodically but is repeatable.  As far as we know this is not happening on 8.0.

我们得到的错误是PresentationCore中的空引用

The error we get is a null reference in PresentationCore

  在System.Windows.Input.StylusLogic.GenerateInRange(RawStylusInputReport rawStylusInputReport)

  在System.Windows.Input.StylusLogic.IsValidStylusAction(RawStylusInputReport rawStylusInputReport)

  在System.Windows.Input.StylusLogic.PreProcessInput(Object sender,PreProcessInputEventArgs e)

  在System.Windows.Input.InputManager.ProcessStagingArea()

   at System.Windows.Input.StylusLogic.GenerateInRange(RawStylusInputReport rawStylusInputReport)
   at System.Windows.Input.StylusLogic.IsValidStylusAction(RawStylusInputReport rawStylusInputReport)
   at System.Windows.Input.StylusLogic.PreProcessInput(Object sender, PreProcessInputEventArgs e)
   at System.Windows.Input.InputManager.ProcessStagingArea()

...

此外,当用户取消或按住键盘时,而不是崩溃 - 有时它会进入手写笔在应用程序中无法正常工作的状态。 悬停不会注册,触摸会注册为悬停。 使用手写笔作为"点击"不可能是
。在这种状态下。 但是触摸和鼠标控制按预期工作。

Also when the user unsnaps or snaps the keyboard, instead of crashing - sometimes it goes into a state where the stylus does not work properly in the application.  The Hover-overs do not register, and the touches register as a hover-over.  It is impossible to use the stylus as a "click" in this state.  However touch and mouse controls work as expected.

我们的应用程序是使用带有C#和xaml的.NET 4.0。

Our application is using .NET 4.0 with C# and xaml.

我们能做什么缓解这个问题?

Is there anything we can do to mitigate this issue?

谢谢,

Damon

推荐答案

即使使用最简单的WPF应用程序,这似乎也会发生。 我在这里创建了一个WPF应用程序项目代码:

This seems to occur even with the simplest of WPF applications.  I created a WPF application project here is the code:

MainWindow.xaml

<Window x:Class="StylusErrorTest.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>
        
        <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
            <Button Content="Test" Height="25" Width="100" Click="Button_Click"/>
            <TextBlock Name="Output" />
        </StackPanel>
        
    </Grid>
</Window>




MainWindow.xaml.cs

using System;
using System.Windows;

namespace StylusErrorTest
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (Output.Text.Length == 0) Output.Text = "Click";
            else Output.Text = "";
        }
    }
}

上述两个问题都会发生。 有时需要15个左右的按键和键盘,有时候更少。  (在每次捕捉或解除锁定之间使用手写笔。)

Both of the issues described above occur.  Sometimes it takes 15 or so snaps and unsnaps of the keyboard, sometimes less.  (Using the stylus between each snap or unsnap).

此外 - 在进一步测试后 - 在Windows 8.0或8.1与Surfaces 1或2的所有组合中都会出现此问题。

Also - after further testing - this issue is occurring in all combinations of Windows 8.0 or 8.1 with Surfaces 1 or 2.

顺便说一句,当它进入中间状态时,悬停不会触发,并且点击就像悬停一样 - Visual Studio 2012也会进入该状态。 摆脱它的唯一方法是重新启动Visual Studio。

Incidentally when it goes into that middle state where the hover-overs do not fire, and the clicks act like hover overs - Visual Studio 2012 enters into that state as well.  The only way to get out of it is to restart Visual Studio.

任何人都可以指向我在这个升级的方向上? 我不熟悉向微软提交门票或如何获得.NET错误的帮助。





这篇关于Surface Pro上的.NET Framework中的空引用Windows 8.1当键盘快照打开或关闭时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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