Sorry same draft PR as before, when i tried syncing my main branch it auto deleted my commits #1
Hi, great work on this control.
Thought I'd just do a draft PR to show an implementation I prefer. I'm not a big fan JSInvokeTarget, think it could add some complexity to some simpler use cases.
So I propose adding 2 methods to Add/ Remove JS callback methods.
That way to don't need a completely separate class that contain all the call back methods, you could simply do this -
// Register in the constructor or anywhere else
myHybridWebView.AddLocalCallback(this, nameof(AddLocalCallBackTest));
private async void AddLocalCallBackTest(string message, int value)
{
WriteToLog($"I'm a .NET method called from JavaScript with message='{message}' and value={value}, using a local registration");
}
Hi, great work on this control.
Thought I'd just do a draft PR to show an implementation I prefer. I'm not a big fan JSInvokeTarget, think it could add some complexity to some simpler use cases.
So I propose adding 2 methods to Add/ Remove JS callback methods.
That way to don't need a completely separate class that contain all the call back methods, you could simply do this -