This is a migrated thread and some comments may be shown as answers.

app crashes when back button is pressed while the messagebox is visible

3 Answers 89 Views
MessageBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gianluc
Top achievements
Rank 1
Gianluc asked on 25 Jan 2014, 05:36 PM
Hello,
when the application displays the messagebox, if the user presses the back button instead of a button shown by the message, the application crashes.

How can I solve this problem?

Below is the code used to create the messagebox:

    MessageBoxClosedEventArgs args = await RadMessageBox.ShowAsync(new CustomHeaderedContentControl[]  {
                new CustomHeaderedContentControl() { Title = AppResources.Salva, Message = AppResources.msgSalvaEMantieniMod },
                new CustomHeaderedContentControl() { Title = AppResources.NonSalvare, Message = AppResources.msgNonSalvareMod },
                new CustomHeaderedContentControl() { Title = AppResources.Annulla, Message = AppResources.msgContAModificare}  },

                  AppResources.ModificheNonSalvate, AppResources.IlTestoEStatoModificato);

                            // ClickedButton will be null in the case when RadMessageBox is closed because the user pressed the hardware back button.
                            if (args.ClickedButton == null) { return; }
                            CustomHeaderedContentControl option = (CustomHeaderedContentControl)args.ClickedButton.Content;
                            if (option.Title == AppResources.Salva) { salvaTestoNuovo(); }
                            if (option.Title == AppResources.NonSalvare) { NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative)); }

3 Answers, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 27 Jan 2014, 01:20 PM
Hello Gianluc,

Thank you for contacting us. Unfortunately I was unable to reproduce the issue. Could you please send us a sample project demonstrating how to reproduce the issue. This way we will be able to assist you better.

Regards,
Kiril Stanoev
TelerikIf you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
0
Gianluc
Top achievements
Rank 1
answered on 01 Feb 2014, 03:52 PM
I solved the problem, it was caused by the creation of another messagebox before the previous one was closed.
0
Victor
Telerik team
answered on 03 Feb 2014, 12:04 PM
Hello Gianluc,

It's great that you managed to go around this. You are correct. Since RadMessageBox is based on RadWindow there cannot be two message boxes open at the same time.

Regards,
Victor
Telerik
If you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
Tags
MessageBox
Asked by
Gianluc
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Gianluc
Top achievements
Rank 1
Victor
Telerik team
Share this question
or