private void button_dalej_Click(object sender, RoutedEventArgs e)
        {
            watek[12] = false;

            progressBar1.Visibility = Visibility.Hidden;

            if (watek_active)
            {
                t1.Abort();
                watek_active = false;
            }

            if (tryb.wlacz_trening())
            {
                if (kinect_active)
                {
                    Thread.Sleep(100);
                    kinectSensor.Stop();

                    foreach (var potentialSensor in KinectSensor.KinectSensors)
                    {
                        if (potentialSensor.Status == KinectStatus.Disconnected)
                        {
                            kinectSensor = null;
                            break;
                        }
                    }
                    this.kinectSensor.SkeletonFrameReady -= this.nui_SkeletonFrameReady;
                    this.kinectSensor.SkeletonStream.Disable();
                }
                Thread.Sleep(500);

                //
                TrybKondycyjny a = new TrybKondycyjny();
                a.Wlacz(tryb, kinect_active, magia);
                a.Show();

                kinect_active = false;
                this.Close();
            }
            else
            {
                textBlock1.Text = "Niepoprawnie uzupełnione \ndane! Nie zaznaczyłeś \nwszystkich elementów!";
            }
        }
        private void button_dalej_Click(object sender, RoutedEventArgs e)
        {
            watek[12] = false;

            progressBar1.Visibility = Visibility.Hidden;

            if (watek_active)
            {
                t1.Abort();
                watek_active = false;
            }

            if (tryb.wlacz_trening())
            {
                if (kinect_active)
                {
                    Thread.Sleep(100);
                    kinectSensor.Stop();

                    foreach (var potentialSensor in KinectSensor.KinectSensors)
                    {
                        if (potentialSensor.Status == KinectStatus.Disconnected)
                        {
                            kinectSensor = null;
                            break;
                        }
                    }
                    this.kinectSensor.SkeletonFrameReady -= this.nui_SkeletonFrameReady;
                    this.kinectSensor.SkeletonStream.Disable();
                }
                Thread.Sleep(500);

                //
                TrybKondycyjny a = new TrybKondycyjny();
                a.Wlacz(tryb, kinect_active, magia);
                a.Show();

                kinect_active = false;
                this.Close();
            }
            else
            {
                textBlock1.Text = "Niepoprawnie uzupełnione \ndane! Nie zaznaczyłeś \nwszystkich elementów!";
            }
        }