如何在 WinJS for Mobile App 中抑制硬件后退按钮事件?

How to suppress an Hardware Backbutton event in WinJS for Mobile App?

没有默认方法,例如 event.stopPropogation() 或 preventDefault()。 如何停止事件的默认行为(硬件后退按钮)?!

这是解决方案。

var app = WinJS.Application;

app.onbackclick = function (evt) {

    // Code that handles event ...

    // Need to return true to cancel the default behavior of this event.
    return true;
}