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

4 posts, 0 answers
  1. Gianluc
    Gianluc avatar
    5 posts
    Member since:
    Nov 2013

    Posted 25 Jan 2014 Link to this post

    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)); }
  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 27 Jan 2014 Link to this post

    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.
  3. DevCraft banner
  4. Gianluc
    Gianluc avatar
    5 posts
    Member since:
    Nov 2013

    Posted 01 Feb 2014 in reply to Kiril Stanoev Link to this post

    I solved the problem, it was caused by the creation of another messagebox before the previous one was closed.
  5. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 03 Feb 2014 Link to this post

    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.
Back to Top
DevCraft banner