Is it possible to simulate "Home" button press in Windows Phone? I'm trying to override back key press and make deactivation because my app has Fast Resume enabled and it is critical for me not to exit by back key but deactivate (home button press)

- 8,084
- 8
- 48
- 62

- 11,414
- 17
- 86
- 167
-
So you wanna deactivate Home Button ? – Mohamed Thaufeeq Oct 26 '13 at 06:45
2 Answers
The only way I know to bring the homescreen without exiting the app is to pin a tile on the homescreen. It's probably not a practical solution.
Either way, what you're trying to do is contradictory with Windows Phone design concepts. The user must stay in control at all time. If the user wants to exit, he'll press the back button. If he wants to keep your application alive, he'll press the home button. If the user isn't able to exit your application even though he wants to, that will create frustration.
Also, remember that GDR3 (the next Windows Phone update) allows the user to close applications directly from the task switcher. There's nothing you will be able to do against that.
Overall, I suggest you try to educate the user, by explaining him with some messages that he shouldn't exit the app with the back button if he wants it to resume quickly. And if he presses the back button anyway, just comply with his wishes.

- 38,392
- 3
- 78
- 94
You can use Device.HardwareButton.Start()
from Microsoft.VisualStudio.TestTools.UITesting
namespace.
For using this namespace you need to add the appropriate reference.

- 9,694
- 16
- 55
- 53

- 1
- 3