Beispiel #1
0
 public void loadframes()
 {
     FitnessFrame.Navigate(new Elements.FitnessScreen());
     DriveFrame.Navigate(new Elements.DriveScreen());
     SettingFrame.Navigate(new Elements.SettingScreen());
     NavigationFrame.Navigate(navigationScreen);
     BorderDrive.BorderThickness = new Thickness(10);
 }
Beispiel #2
0
 public void startFitness()
 {
     if (isDrivingHAD)
     {
         FitnessFrame.Navigate(null);
         fitnessAcitve = true;
     }
     else
     {
         Debug.Print("Fitness not available isDrivingHAD: " + isDrivingHAD);
     }
 }
Beispiel #3
0
        public void changemainframeleft(int mainframekey)
        {
            Debug.Print("changemainframeleft called");
            var lefttransfrommain = new ThicknessAnimation()
            {
                From     = new Thickness(4000, 0, 0, 0),
                To       = new Thickness(6000, 0, 0, 0),
                Duration = TimeSpan.FromMilliseconds(500),
            };

            var lefttranstomain = new ThicknessAnimation()
            {
                From     = new Thickness(2000, 0, 0, 0),
                To       = new Thickness(4000, 0, 0, 0),
                Duration = TimeSpan.FromMilliseconds(500)
            };

            var leftopacityfrommain = new DoubleAnimation()
            {
                From     = 1,
                To       = 0,
                Duration = TimeSpan.FromMilliseconds(500)
            };

            var leftopacitytomain = new DoubleAnimation()
            {
                From     = 0,
                To       = 1,
                Duration = TimeSpan.FromMilliseconds(500)
            };

            Debug.Print("Animations built");
            // mainframekey: 1 is settingscreen, 2 is navigation, 3 is drivescreen, 4 is fitnessscreen
            switch (mainframekey) // gibt an welcher screen angezeigt wird

            {
            case 0:
                Debug.Print("case 0 called");
                break;

            case 1:     // von setting nach fitness

                SettingFrame.BeginAnimation(Frame.MarginProperty, lefttransfrommain);
                FitnessFrame.BeginAnimation(Frame.MarginProperty, lefttranstomain);
                SettingFrame.BeginAnimation(Frame.OpacityProperty, leftopacityfrommain);
                FitnessFrame.BeginAnimation(Frame.OpacityProperty, leftopacitytomain);
                Debug.Print("Case 1");
                break;

            case 2:     // von navigation nach setting

                NavigationFrame.BeginAnimation(Frame.MarginProperty, lefttransfrommain);
                SettingFrame.BeginAnimation(Frame.MarginProperty, lefttranstomain);
                NavigationFrame.BeginAnimation(Frame.OpacityProperty, leftopacityfrommain);
                SettingFrame.BeginAnimation(Frame.OpacityProperty, leftopacitytomain);
                Debug.Print("Case 2");
                break;

                //case 3: // von drive nach navigation

                DriveFrame.BeginAnimation(Frame.MarginProperty, lefttransfrommain);
                NavigationFrame.BeginAnimation(Frame.MarginProperty, lefttranstomain);
                DriveFrame.BeginAnimation(Frame.OpacityProperty, leftopacityfrommain);
                NavigationFrame.BeginAnimation(Frame.OpacityProperty, leftopacitytomain);
                Debug.Print("Case 3");
                break;

            case 4:     // von fitness nach drive

                FitnessFrame.BeginAnimation(Frame.MarginProperty, lefttransfrommain);
                DriveFrame.BeginAnimation(Frame.MarginProperty, lefttranstomain);
                FitnessFrame.BeginAnimation(Frame.OpacityProperty, leftopacityfrommain);
                DriveFrame.BeginAnimation(Frame.OpacityProperty, leftopacitytomain);
                Debug.Print("Case 4");
                break;

            default:
                Debug.Print("no case called");
                break;
            }
        }
Beispiel #4
0
        public void changemainframeright(int mainframekey) // int direction (1 or 2) 1 is right 2 is left
        {
            var righttransfrommain = new ThicknessAnimation()
            {
                From     = new Thickness(4000, 0, 0, 0),
                To       = new Thickness(2000, 0, 0, 0),
                Duration = TimeSpan.FromMilliseconds(500)
            };

            var righttranstomain = new ThicknessAnimation()
            {
                From     = new Thickness(6000, 0, 0, 0),
                To       = new Thickness(4000, 0, 0, 0),
                Duration = TimeSpan.FromMilliseconds(500)
            };

            var rightopacityfrommain = new DoubleAnimation()
            {
                From     = 1,
                To       = 0,
                Duration = TimeSpan.FromMilliseconds(500)
            };

            var rightopacitytomain = new DoubleAnimation()
            {
                From     = 0,
                To       = 1,
                Duration = TimeSpan.FromMilliseconds(500)
            };

            // mainframekey: 1 is settingscreen, 2 is navigation, 3 is drivescreen, 4 is fitnessscreen

            //right -> nach links gewischt

            switch (mainframekey)
            {
            case 1:     //von setting nach navigation
                SettingFrame.BeginAnimation(Frame.MarginProperty, righttransfrommain);
                NavigationFrame.BeginAnimation(Frame.MarginProperty, righttranstomain);
                SettingFrame.BeginAnimation(Frame.OpacityProperty, rightopacityfrommain);
                NavigationFrame.BeginAnimation(Frame.OpacityProperty, rightopacitytomain);

                break;


            case 2:     //von navigation nach drive
                NavigationFrame.BeginAnimation(Frame.MarginProperty, righttransfrommain);
                DriveFrame.BeginAnimation(Frame.MarginProperty, righttranstomain);
                NavigationFrame.BeginAnimation(Frame.OpacityProperty, rightopacityfrommain);
                DriveFrame.BeginAnimation(Frame.OpacityProperty, rightopacitytomain);

                break;

            case 3:     // von drive nach fitness
                DriveFrame.BeginAnimation(Frame.MarginProperty, righttransfrommain);
                FitnessFrame.BeginAnimation(Frame.MarginProperty, righttranstomain);
                DriveFrame.BeginAnimation(Frame.OpacityProperty, rightopacityfrommain);
                FitnessFrame.BeginAnimation(Frame.OpacityProperty, rightopacitytomain);

                break;

            case 4:     // von fitness nach setting
                FitnessFrame.BeginAnimation(Frame.MarginProperty, righttransfrommain);
                SettingFrame.BeginAnimation(Frame.MarginProperty, righttranstomain);
                FitnessFrame.BeginAnimation(Frame.OpacityProperty, rightopacityfrommain);
                SettingFrame.BeginAnimation(Frame.OpacityProperty, rightopacitytomain);
                break;
            }
        }
Beispiel #5
0
        public void changemainframein(int mainframekey, int direction) // direction 1 is right 2 is left
        {
            ThicknessAnimation moveinright = new ThicknessAnimation()
            {
                From              = new Thickness(6200, 0, 0, 50),
                To                = new Thickness(4200, 0, 0, 50),
                Duration          = TimeSpan.FromMilliseconds(500),
                AccelerationRatio = 0.4
            };

            ThicknessAnimation moveinleft = new ThicknessAnimation()
            {
                From              = new Thickness(2200, 0, 0, 50),
                To                = new Thickness(4200, 0, 0, 50),
                Duration          = TimeSpan.FromMilliseconds(500),
                AccelerationRatio = 0.4
            };

            DoubleAnimation blendin = new DoubleAnimation()
            {
                From     = 0,
                To       = 1,
                Duration = TimeSpan.FromMilliseconds(300)
            };

            switch (mainframekey)
            {
            case 1:     //setting
                if (direction == 1)
                {
                    SettingFrame.BeginAnimation(Frame.MarginProperty, moveinleft);
                }
                else if (direction == 2)
                {
                    SettingFrame.BeginAnimation(Frame.MarginProperty, moveinright);
                }
                SettingFrame.BeginAnimation(Frame.OpacityProperty, blendin);

                break;


            case 2:     //navigation
                if (direction == 1)
                {
                    NavigationFrame.BeginAnimation(Frame.MarginProperty, moveinleft);
                }
                else if (direction == 2)
                {
                    NavigationFrame.BeginAnimation(Frame.MarginProperty, moveinright);
                }
                NavigationFrame.BeginAnimation(Frame.OpacityProperty, blendin);

                break;

            case 3:     //drive
                if (direction == 1)
                {
                    DriveFrame.BeginAnimation(Frame.MarginProperty, moveinleft);
                }
                else if (direction == 2)
                {
                    DriveFrame.BeginAnimation(Frame.MarginProperty, moveinright);
                }
                DriveFrame.BeginAnimation(Frame.OpacityProperty, blendin);

                break;

            case 4:     //fitness
                if (direction == 1)
                {
                    FitnessFrame.BeginAnimation(Frame.MarginProperty, moveinleft);
                }
                else if (direction == 2)
                {
                    FitnessFrame.BeginAnimation(Frame.MarginProperty, moveinright);
                }
                FitnessFrame.BeginAnimation(Frame.OpacityProperty, blendin);
                break;

            default:
                Debug.Print("no case called");
                break;
            }
        }
Beispiel #6
0
 public void endFitness()
 {
     SubFrame.Navigate(null);
     FitnessFrame.Navigate(new Elements.FitnessScreen()); //to be changed
     fitnessAcitve = false;
 }