获取RotationChanged事件时,使用RadialController滚动Webview

时间:2017-02-20 15:19:12

标签: c# webview uwp

我正在使用Surface Dial在UWP应用程序中滚动WebView。我想在保留滚动功能的同时抓住RadialController类的RotationChanged事件。

但是,要获取RotationChanged事件,我当前必须添加一个新的RadialControllerMenuItem,并在应用程序启动之后选择它,然后才会收到任何事件。当我这样做时,WebView不会像之前那样滚动。

甚至可以同时执行此操作吗?

1 个答案:

答案 0 :(得分:0)

我最终在WebView中触发了一个keydown-Event,它在我的场景中运行良好。然后该站点使用jQuery对事件做出反应。

string script = "var e = $.Event('keydown'); e.which = 40; $('body').trigger(e);"
string[] scriptArgs = { script };
await WebView.InvokeScriptAsync("eval", scriptArgs);