public void OpenDistanceChecker(Patient _currentPatient, Training _currentTraining)
 {
     using (DistanceWindow distanceWindow = new DistanceWindow(_currentPatient, _currentTraining, null))
     {
         distanceWindow.mainWindow = this;
         this.Content = distanceWindow;
     }
 }
        private void _trainingSelection_StartPlaylist(Training currentTraining)
        {
            
            if (_currentTraining.IsTraceableTraining)
            {
                userInDistanceSemaphore = new SemaphoreSlim(1);
                userInDistanceSemaphore.Wait();

                worker.RunWorkerAsync();

                using (DistanceWindow distance = new DistanceWindow(_currentPatient, currentTraining, this))
                {
                    this.Content = distance;
                    
                    Console.WriteLine("distance wait finish");
                    //distance.trainingMenu = this;
                }
                //MainWindow.OpenDistanceChecker(_currentPatient, _currentTraining);
            }
            else
            {
                MainWindow.OpenExerciseWindow(_currentPatient, _currentTraining);
            }

            
            //barrier.SignalAndWait();
        }