void GoBackButton_Click(object sender, RoutedEventArgs e)
        {
            interruptFeedback.GoBackButton.Click -= GoBackButton_Click;
            stopButton.Click += stopButton_Click;
            reportStopButton.Click += reportStopButton_Click;
            logStopButton.Click += logStopButton_Click;
            myCanvas.Children.Remove(interruptFeedback);
            interruptFeedback = null;
            myState = currentState.play;
            if (parent.rulesAnalyzer.interruption)
            {
                parent.rulesAnalyzer.interrupted = false;
                //parent.rulesAnalyzer.reset();
                parent.rulesAnalyzer.resetForMistake((Mistake)parent.rulesAnalyzer.feedBackList[parent.rulesAnalyzer.feedBackList.Count - 1]);
            }

        }
 void GoToMainMenuButton_Click(object sender, RoutedEventArgs e)
 {
     stopButton.Click += stopButton_Click;
     reportStopButton.Click += reportStopButton_Click;
     logStopButton.Click += logStopButton_Click;
     if (parent.rulesAnalyzer.interruption)
     {
         parent.rulesAnalyzer.makeLog();
     }
     myCanvas.Children.Remove(interruptFeedback);
     interruptFeedback = null;
     reportFeedback = null;
     myState = currentState.play;
     parent.freeStyleMode_reportStopButton_Click(null, null);
 }
        void GoToExercises_Click(object sender, RoutedEventArgs e)
        {
            PresentationAction pa = interruptFeedback.mistakes[0].Clone();
            
            parent.loadIndividualSkills(pa);

            try
            {
                myCanvas.Children.Remove(interruptFeedback);
                interruptFeedback = null;
                // myState = currentState.play;
                setGhostMovingInvisible();
                setOldTextInvisible();
                setGhostInvisible();
                setFeedbackTextInvisible();
            }
            catch
            {
                
            }
            
        }
        public void OrdinaryReturn_Click(object sender, RoutedEventArgs e)
        {
            
            stopButton.Click += stopButton_Click;
            reportStopButton.Click += reportStopButton_Click;
            logStopButton.Click += logStopButton_Click;
            PresentationAction temp = null;
            if (interruptFeedback != null)
            {
                temp = interruptFeedback.mistakes[0].Clone();
            }            
            if(interruptFeedback!=null)
            {
                interruptFeedback.GoBackButton.Click -= GoBackButton_Click;
                myCanvas.Children.Remove(interruptFeedback);
                interruptFeedback = null;
            }
           
           // myState = currentState.play;
            setGhostMovingInvisible();
            setOldTextInvisible();
            setGhostInvisible();
            setFeedbackTextInvisible();
            textFeedback.FeedbackIMG.Visibility = Visibility.Visible;

            countdownPause.animationStarted = false;
            countdown.startAnimation();
            //parent.rulesAnalyzerFIFO.lastFeedbackTime = DateTime.Now.TimeOfDay.TotalMilliseconds;
            //parent.rulesAnalyzerFIFO.resetAfterInterruption();

            try
            {
                parent.rulesAnalyzerImproved.lastFeedbackTime = DateTime.Now.TimeOfDay.TotalMilliseconds;                
                parent.rulesAnalyzerImproved.resetAfterInterruption(temp);
            }
            catch
            {

            }
            
            //if (parent.rulesAnalyzer.interruption)
            //{
            //    parent.rulesAnalyzer.interrupted = false;
            //    //parent.rulesAnalyzer.reset();
            //    parent.rulesAnalyzer.resetForMistake((Mistake)parent.rulesAnalyzer.feedBackList[parent.rulesAnalyzer.feedBackList.Count - 1]);
            //}
        }
 public void loadInterruption(PresentationAction[] x)
 {
     myState = currentState.stop;
     interruptFeedback = new InterruptFeedback();
     interruptFeedback.mistakes = x;
     myCanvas.Children.Add(interruptFeedback);
     Canvas.SetLeft(interruptFeedback, 20);
     Canvas.SetTop(interruptFeedback, 20);
     interruptFeedback.GoBackButton.Click += OrdinaryReturn_Click;
     interruptFeedback.GoToExercises.Click += GoToExercises_Click;
    // interruptFeedback.GoToMainMenuButton.
     //interruptFeedback.GoBackButton.Click += GoBackButton_Click;
    // interruptFeedback.GoToMainMenuButton.Click += GoToMainMenuButton_Click;
     stopButton.Click -= stopButton_Click;
     reportStopButton.Click -= reportStopButton_Click;
     logStopButton.Click -= logStopButton_Click;
 }