Start a new topic

DuoCode.Dom.Event missing event name parameter for contructor

you cant do a:

Event e = new Event("MyEvent");

No parameter to pass event name so it errors out in javascript.

i have to do a:

Event e = Js.ReferenceAs<dynamic>(@"new Event('MyEvent')");

Just so you know... maybe you can add that to the DuoCode.Dom.Event binding

Also... Is there a way to provide extensions to override this type thing...

Like could i create an extension to add the new constructor to the ALREADY existing DuoCode.Dom classes ... but i think they are sealed or something.

BTW... My Captcha code to enter this post was '420'


1 Comment

Thanks for reporting, we already fixed.

Dom classes are not sealed, but still it's difficult to extend them from your project.

In your case it's better to use 

T Js.@new<T>(JsObject target, params object[] arguments);

 operator found in DuoCode.Runtime.Js class.

Login or Signup to post a comment