Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6602361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:52:03+00:00 2026-05-25T18:52:03+00:00

I have a pivot control and a button which does selectedIndex++ and when the

  • 0

I have a pivot control and a button which does selectedIndex++ and when the selectedIndex has gone passed the last entry it will open up a messagebox asking the user if they want to quiz.

But during testing if you spam the button it will create a 0x8000ffff error when you open the MessageBox.

How do I stop this from happening? is it something to do with the ui thread being too busy or continuing to move the pivot? is the button event still running after I try to navigate out of the page?

this is what the code that does the selectedIndex++

void gotoNextQuestion()
{
    if (quizPivot.SelectedIndex < App.settings.currentTest.Questions.Count() - 1)
    {
        //xScroll -= scrollAmount;
        //moveBackground(xScroll);

        if (!stoppedPaging)
        {
            quizPivot.SelectedIndex++;
        }

        //App.PlaySoundKey("next");
    }
    else
    {
        if (App.settings.testMode == App.TestModes.TrainingRecap)
        {
            MessageBoxResult result;

            if (countAnsweredQuestions() == App.settings.currentTest.Questions.Count())
            {
                stoppedPaging = true;
                result = MessageBox.Show("You have reviewed every training question, would you like to go back to the main menu?", "Training Over", MessageBoxButton.OKCancel);
                stoppedPaging = false;
                if (result == MessageBoxResult.OK)
                {
                    positionableSpriteRadioButton.IsAnswered -= new Action<bool>(Answers_IsAnsweredCompleted);
                    spriteRadioButton.IsAnswered -= new Action<bool>(Answers_IsAnsweredCompleted);
                    App.settings.currentTest = null;
                    NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
                    return;
                }
            }
        }
        else
        {
            MessageBoxResult result;

            if (countAnsweredQuestions() == App.settings.currentTest.Questions.Count())
            {
                stoppedPaging = true;
                result = MessageBox.Show("You have answered all of the questions, are you sure you want to finish?", "Are you sure you want to finish?", MessageBoxButton.OKCancel);
                stoppedPaging = false;
            }
            else
            {
                checkFinishConditions();
            }
        }

        quizPivot.SelectedIndex = 0;
        //App.PlaySoundKey("begin");
    }

    App.settings.currentTest.currentQuestion = quizPivot.SelectedIndex;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:52:04+00:00Added an answer on May 25, 2026 at 6:52 pm

    Well, one thing is for sure

    positionableSpriteRadioButton.IsAnswered -= new Action<bool>(Answers_IsAnsweredCompleted); 
    

    That isn’t going to work. You’re creating a new Action every time. So nothing will have the same reference id, and thus nothing will be removed.

    Instead you should remove the Action<bool> and simply subscribe/unsubscribe with

    positionableSpriteRadioButton.IsAnswered -= Answers_IsAnsweredCompleted;
    

    And when you subscribe

    positionableSpriteRadioButton.IsAnswered += Answers_IsAnsweredCompleted;
    

    That way you can actually remove it again.

    But I would recommend you not to use a pivot for this type of “wizard”. It’s abuse of the control, and going to give a really poor user experience.

    Also, just because you navigate to another page, it doesn’t mean the code stops running. All code in the same expression is executed, unless you add a return statement after the call to NavigationService.Navigate.

    Also, always make sure that Navigation is on the UI thread by wrapping all calls to NavigationService.Navigate in a call to Dispatcher.BeginInvoke.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wish to have a Pivot control that has PivotItems but no pivot item
I have an Excel spreadsheet which has a pivot table on it. The data
I have a Pivot control which I am using as following within the XAML.
I have a Pivot which contains a WebBrowser control that practically takes up the
I want to have panorama control (or pivot ) that each PanoramaItem will be
Does anyone have an example of a pivot using a table with an XML
I have looked into pivot but I think it requires an aggregate function which
I have very strange issue. In my WP7 app I have a pivot control
I have a list on images in a Pivot control. If you touch an
I have made a calendar control based on the pivot control. Every pivot item

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.