Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/algorithm/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 8.1通用应用程序。从网格或页面获取用户输入(按键关闭事件)_C#_Xaml_Windows 8.1_Win Universal App - Fatal编程技术网

C# 8.1通用应用程序。从网格或页面获取用户输入(按键关闭事件)

C# 8.1通用应用程序。从网格或页面获取用户输入(按键关闭事件),c#,xaml,windows-8.1,win-universal-app,C#,Xaml,Windows 8.1,Win Universal App,我对使用XAML很陌生,想知道是否可以通过一次抓取一个字符直接从网格或页面获取用户键盘输入 我一直在尝试使用我放在网格和页面上的KeyDown事件,但唯一的触发方式似乎是按下enter键或将其切换到选项卡上 我想知道我是否可能需要将焦点放在它们上以捕获输入 <Page x:Class="Test.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:s="http://schema

我对使用XAML很陌生,想知道是否可以通过一次抓取一个字符直接从网格或页面获取用户键盘输入

我一直在尝试使用我放在网格和页面上的KeyDown事件,但唯一的触发方式似乎是按下enter键或将其切换到选项卡上

我想知道我是否可能需要将焦点放在它们上以捕获输入

<Page
x:Class="Test.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:s="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Test"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" KeyDown="Page_KeyDown" Loaded="Page_Loaded"
>

<Grid  Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" KeyDown="Grid_KeyDown">

</Grid>

任何关于如何实现这一目标的想法都将不胜感激

谢谢