Hello!
When the enteringBackground
event is performed, I want the function on the current page to be executed.
If the page is page2 when the enteringBackground
event is performed, I would like to execute the {page2} function.
Even if it is not Activated Handler
, I want to know if there is a way to do it!
<App>
<JavaScript>
var Lifecycle = require('FuseJS/Lifecycle');
var Observable = require('FuseJS/Observable');
Lifecycle.on("enteringForeground", function() {
console.log("on enteringForeground");
});
Lifecycle.on("enteringInteractive", function() {
console.log("on enteringInteractive");
});
Lifecycle.on("exitedInteractive", function() {
console.log("on exitedInteractive");
});
Lifecycle.on("enteringBackground", function() {
console.log("on enteringBackground");
});
function page1() {
console.log('page1 activated');
}
function page2() {
console.log('page2 activated');
}
module.exports = {
page1, page2
}
</JavaScript>
<DockPanel Placed="{placed}">
<PageControl>
<Panel>
<Activated Handler="{page1}" Path="Local"/>
<Text Value="page1"/>
</Panel>
<Panel>
<Activated Handler="{page2}" Path="Local"/>
<Text Value="page2"/>
</Panel>
</PageControl>
</DockPanel>
</App>