【发布时间】:2022-06-27 06:20:23
【问题描述】:
我为自助服务创建了一个 KIOSK 应用程序。产品列表以编程方式生成。在每个窗口上,程序都可以在触摸屏上正常工作。除了一个窗口,我必须在它开始工作之前准确地触摸 10 次。我试图重新制作那个窗口,我只在上面放了一个按钮,但它是一样的。如果我禁用手写笔并触摸支持:
<AppContextSwitchOverrides value="Switch.System.Windows.Input.Stylus.DisableStylusAndTouchSupport=true"/>
比它有效。但这会禁用触摸滚动,这是良好的用户体验所必需的。
如果我使用 touchdown 或类似的东西,它可以工作,但我在那个窗口上有 CheckBox 和 RadioButton,我无法捕捉到任何触摸事件。有什么想法吗?
即使我从我的代码中清除所有内容,或者我创建一个具有相同名称的新窗口,它也不起作用...
这是我的 windows xml:
<Window x:Class="GestbalSelfSalePOS.ProdusComandaDetailsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:GestbalSelfSalePOS"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
Title="ProdusComandaDetailsWindow">
<Grid>
<Button Click="BackButton_Click" Content="Button" Margin="120"/>
</Grid>
</Window>
我的客服:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace GestbalSelfSalePOS
{
/// <summary>
/// Interaction logic for ProdusComandaDetailsWindow.xaml
/// </summary>
public partial class ProdusComandaDetailsWindow : Window
{
public ProdusComandaDetailsWindow()
{
InitializeComponent();
}
private void BackButton_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
}
}
这就是我打开这个窗口的方式:
new ProdusComandaDetailsWindow().ShowDialog();
【问题讨论】:
-
请提供足够的代码,以便其他人更好地理解或重现问题。
-
如何使用 snoop 之类的应用(或自行注册)来检查捕获事件的内容?
-
我不知道那个应用,你能给我链接一下吗?
标签: c# wpf scroll touch stylus