Hi,
There is no way for you to directly handle touch event on the C# side. You would need to handle the touch event with JavaScript and then call into C# from your JavaScript code. The basic steps can be like this:
1. Use WebView.JSInitCode to inject additional JavaScript code into the page that handles the touch event. For example, the following code handles document.body.touchstart event in JavaScript;
Code: JavaScript
webView.JSInitCode = @"
window.addEventListener('load', function(e)
{{
document.body.addEventListener('touchstart', function(e)
{{
eoapi.extInvoke('touchStart');
}});
}});
";
2. Handle the touch event however you need in your JavaScript code. Then when necessary calls into C# side through eoapi.extInvoke. For demonstration purpose the above code calls into C# side immediately from touchstart event handler. In practice this is not recommended. For performance reason, it is recommended that you do as much work as possible in JavaScript code and then only "report" the result back to C# side. For example, if you need to handle touch event to implement drag and drop an item from one place to another place in your page, instead of calling into C# side on every touch event (touchstart, touchmove, touchend, touchcancel), you can handle all these events in JavaScript code and only calls back to C# side when an item has been successfully dropped;
3. You would then handle WebView.JSExtInvoke event on C# side that handles the JavaScript side eoapi.extInvoke call;
Hope this helps. Please feel free to let us know if you have any more questions.
Thanks!