控制按“后退按钮”并禁用使用确认对话框关闭应用程序 - wp7
我需要显示一个简单的对话框,其中包含以下问题:“您想退出应用程序吗?”是还是不是。 当用户按下设备的后退按钮时,将显示此对话框。
我知道如何显示此对话框,但我不知道如何禁用后退操作:关闭应用程序。
它总是关闭的。
I need show a simple dialog with the question : 'Do you want to exit the application?' YES or NO.
This dialog will be shown when the user presses the back button of the device.
I know how I can show this dialog , but I don't know how to disable the back action: close app.
It's always closed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我理解正确的话,当用户单击应用程序主页上的后退按钮时,您希望显示一个确认对话框,询问他们是否真的要退出。如果用户选择“是”,应用程序将退出,否则您将取消后退导航。为此,请在 MainPage 类构造函数中连接一个事件处理程序
If I understand you correctly, you want to display a confirmation dialog when the user clicks the back button on the main page of your app to ask whether they really want to exit. If the user selects Yes the app exits, otherwise you cancel the back navigation. To do this, in the MainPage class constructor hook up an event handler