Frage

I am trying to show user MessageBox just before app is closed (or deactivated). So I added this to both events:

if (AppSettings.ShouldShowAlertTransfer)
                {
                    MessageBox.Show("...");
                }

But the MessageBox is not shown. I am adding this because then I am adding background transfers and I must inform user that I created some background trasnfers. I know I can add this code to OnKeyBackPressed in every page. But it's working just for back key and not middle button. And it wouldn't be nice to have same code copied in every page.

So is it possible to show this MessageBox in App.xaml.cs? How can I do that? If it's not how can I show MessageBox when user pressed middle button?

War es hilfreich?

Lösung

I was intrigued by your question so I opened up a solution and attempted every single override available and every single page event. I also tried all of the methods in the App.xaml.cs.

I can unequivocally say, based on the MSDN documentation and my own personal testing that there is no way to detect the home button press or search button press. Furthermore there is no way to display a message box to temporarily stop one of these actions.

This testing was done on Windows Phone 8 with the WVGA 512MB Emulator in Visual Studio 2013 Ultimate.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top