Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WinJS.Application.addEventListener vs. WinJS.Application.onActivated

Tags:

winjs

The MSDN documentation shows two options for setting up the onactivated event for Win8 WinJS apps:

WinJS.Application.addEventListener("activated", listenerName);

or

WinJS.Application.onactivated = listenerName;

Do both options behave identically under the hood, or are there reasons to use one approach over the other?

like image 276
RSW Avatar asked Mar 06 '26 21:03

RSW


1 Answers

These are the same. "onactivated" is the free onFoo event created by the WinJS Event mixin helpers. You can use either with impunity.

I prefer the addEventListener pattern myself.

like image 154
Dominic Hopton Avatar answered Mar 11 '26 10:03

Dominic Hopton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!