Xamarin 属性、索引器或事件';CoreWindow.PointerPressed';该语言不支持

Xamarin 属性、索引器或事件';CoreWindow.PointerPressed';该语言不支持,xamarin,xamarin.forms,uwp,event-handling,Xamarin,Xamarin.forms,Uwp,Event Handling,我有一个Xamarin Forms UWP项目,我正在尝试向Window.Current.CoreWindow.PointerPressed添加一个处理程序,它工作得非常好,直到我再次构建,现在我发现了这个问题 protected override void OnAppearing() { Window.Current.CoreWindow.PointerPressed += CoreWindow_PointerPressed; Window.Current.CoreWindow

我有一个Xamarin Forms UWP项目,我正在尝试向Window.Current.CoreWindow.PointerPressed添加一个处理程序,它工作得非常好,直到我再次构建,现在我发现了这个问题

protected override void OnAppearing()
{
    Window.Current.CoreWindow.PointerPressed += CoreWindow_PointerPressed;
    Window.Current.CoreWindow.KeyDown += CoreWindow_KeyDown;
}

private void CoreWindow_PointerPressed(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.PointerEventArgs args)
{
    tcPageTimeOut?.RestartTimer();
}

private void CoreWindow_KeyDown(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.KeyEventArgs args)
{
    tcPageTimeOut?.RestartTimer();
}
将处理程序分配给KeyDown事件时也会发生同样的情况

错误CS1545属性、索引器或事件“CoreWindow.PointerPressed”不受语言支持;请尝试直接调用访问器方法“CoreWindow.add_PointerPressed(TypeDevenHandler)”或“CoreWindow.remove_PointerPressed(EventRegistrationToken)”

最低版本:16299

目标版本:18362

<> P>我注意到ActhBeLeFieldField.FaskPrimeStand and Word.Studio.UnvialSalpChanCoupe是16299版本,我假设是正确的,这是Min版本。但它们是否应该与目标版本匹配

是否有人知道必须解决此问题,或者有其他方法来捕获应用程序范围内的点压缩


感谢

,它工作得非常好,直到我再次构建,现在我得到了这个问题,你能提供更多关于使用CoreWindow.PointerPressed的代码吗?我已经检查过了,我可以从我的UWP项目访问Window.Current.CoreWindow.PointerPressed,但不是我的主项目?是否有设置阻止此操作?我尝试在PCL ContentPage中添加Window.Current.CoreWindow.PointerPressed事件以再现您的问题,但失败了,因此您可以在此处提供一个简单的示例吗?@CherryBu MSFT当您说您失败时,是不是无法再现我的问题,这意味着您成功地添加了?