Search code examples
windowswindows-phonewindows-phone-8.1winjswin-universal-app

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


There are no default methods like, event.stopPropogation() or preventDefault(). How do I stop the default behaviour of the event(Hardware Backbutton)?!


Solution

  • Here is the solution.

    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;
    }