Eto.Forms React.js integration

Hey @oguzhankoral,

Using Eto’s WebView you can have two way communication by way of the WebView.DocumentLoading event… something in the form of:

var webView = new WebView();

webView.DocumentLoading += (sender, e) =>
{
	if (e.Uri.Scheme == "myscheme")
	{
		e.Cancel = true; // prevent navigation
		
		var path = e.Uri.PathAndQuery;
		if (path == "dosomething")
		{
			// do something..
		}
	}
};

… then in your javascript you only need to do something like:

window.location = 'myscheme:dosomething';

To communicate back to javascript you can use WebView.ExecuteScript()

Hope this helps!

2 Likes