Search code examples
.netwindows-phone-8.1windows-phone

How to disable back start, search button in windows phone 8.1 app


I am developing a windows phone app in 8.1. app have a requirement to deactivate the three button click once app is launched. i.e Back button, Start button and Search button. Please suggest the best approach to achieve this.


Solution

  • You can't disable start and search button . But you can manage back button taps if your app is in foreground.

    You can use BackPressed event to manage back button taps . Use the below code to subscribe to the event.

     HardwareButtons.BackPressed += HardwareButtons_BackPressed;
    

    event handler

    void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
    {      
            e.Handled = true;  // this will cancel the navigation         
    }
    

    You can find more info from here