Example #1
0
        private void Navigation()
        {
            int         i          = Choosing.Num_Animal;
            BitmapImage page_1     = new BitmapImage();
            BitmapImage page_2     = new BitmapImage();
            BitmapImage page_3     = new BitmapImage();
            BitmapImage food_img_1 = new BitmapImage();
            BitmapImage food_img_2 = new BitmapImage();
            BitmapImage food_img_3 = new BitmapImage();

            // bi3.BeginInit();
            // bi3.UriSource = new Uri(".PNG", UriKind.Relative);
            // bi3.EndInit();
            switch (i)
            {
            case (1):
            {
                page_1.BeginInit();
                page_1.UriSource = new Uri("/Image/training/1/fox.png", UriKind.Relative);
                page_1.EndInit();
                page_2.BeginInit();
                page_2.UriSource = new Uri("/Image/training/2/fox.png", UriKind.Relative);
                page_2.EndInit();
                page_3.BeginInit();
                page_3.UriSource = new Uri("/Image/training/3/fox.png", UriKind.Relative);
                page_3.EndInit();
                food_img_1.BeginInit();
                food_img_1.UriSource = new Uri("/Image/food/жук.png", UriKind.Relative);
                food_img_1.EndInit();
                food_img_2.BeginInit();
                food_img_2.UriSource = new Uri("/Image/food/грызун.png", UriKind.Relative);
                food_img_2.EndInit();
                food_img_3.BeginInit();
                food_img_3.UriSource = new Uri("/Image/food/ягоды.png", UriKind.Relative);
                food_img_3.EndInit();
                Animation_Animal = (Storyboard)FindResource("fox");

                src = ResourceController.GetResourceBitmap("/Image/CmpGM/AnimalChildren/fox.png");
                break;
            }

            case (2):
            {
                page_1.BeginInit();
                page_1.UriSource = new Uri("/Image/training/1/bear.png", UriKind.Relative);
                page_1.EndInit();
                page_2.BeginInit();
                page_2.UriSource = new Uri("/Image/training/2/bear.png", UriKind.Relative);
                page_2.EndInit();
                page_3.BeginInit();
                page_3.UriSource = new Uri("/Image/training/3/fox.png", UriKind.Relative);
                page_3.EndInit();
                food_img_1.BeginInit();
                food_img_1.UriSource = new Uri("/Image/food/ягоды.png", UriKind.Relative);
                food_img_1.EndInit();
                food_img_2.BeginInit();
                food_img_2.UriSource = new Uri("/Image/food/rastenia.png", UriKind.Relative);
                food_img_2.EndInit();
                food_img_3.BeginInit();
                food_img_3.UriSource = new Uri("/Image/food/ryba.png", UriKind.Relative);
                food_img_3.EndInit();
                Animation_Animal = (Storyboard)FindResource("bear");

                src = ResourceController.GetResourceBitmap("/Image/CmpGM/AnimalChildren/bear.png");
                break;
            }

            case (3):
            {
                page_1.BeginInit();
                page_1.UriSource = new Uri("/Image/training/1/wolf.png", UriKind.Relative);
                page_1.EndInit();
                page_2.BeginInit();
                page_2.UriSource = new Uri("/Image/training/2/wolf.png", UriKind.Relative);
                page_2.EndInit();
                page_3.BeginInit();
                page_3.UriSource = new Uri("/Image/training/3/fox.png", UriKind.Relative);
                page_3.EndInit();
                food_img_1.BeginInit();
                food_img_1.UriSource = new Uri("/Image/food/жук.png", UriKind.Relative);
                food_img_1.EndInit();
                food_img_2.BeginInit();
                food_img_2.UriSource = new Uri("/Image/food/грызун.png", UriKind.Relative);
                food_img_2.EndInit();
                food_img_3.BeginInit();
                food_img_3.UriSource = new Uri("/Image/food/ягоды.png", UriKind.Relative);
                food_img_3.EndInit();
                Animation_Animal = (Storyboard)FindResource("wolf");

                src = ResourceController.GetResourceBitmap("/Image/CmpGM/AnimalChildren/wolf.png");
                break;
            }

            case (4):
            {
                page_1.BeginInit();
                page_1.UriSource = new Uri("/Image/training/1/lynx.png", UriKind.Relative);
                page_1.EndInit();
                page_2.BeginInit();
                page_2.UriSource = new Uri("/Image/training/2/lynx.png", UriKind.Relative);
                page_2.EndInit();
                page_3.BeginInit();
                page_3.UriSource = new Uri("/Image/training/3/fox.png", UriKind.Relative);
                page_3.EndInit();
                food_img_1.BeginInit();
                food_img_1.UriSource = new Uri("/Image/food/жук.png", UriKind.Relative);
                food_img_1.EndInit();
                food_img_2.BeginInit();
                food_img_2.UriSource = new Uri("/Image/food/грызун.png", UriKind.Relative);
                food_img_2.EndInit();
                food_img_3.BeginInit();
                food_img_3.UriSource = new Uri("/Image/food/ягоды.png", UriKind.Relative);
                food_img_3.EndInit();
                Animation_Animal = (Storyboard)FindResource("lynx");

                src = ResourceController.GetResourceBitmap("/Image/CmpGM/AnimalChildren/lynx.png");
                break;
            }

            case (5):
            {
                page_1.BeginInit();
                page_1.UriSource = new Uri("/Image/training/1/hare.png", UriKind.Relative);
                page_1.EndInit();
                page_2.BeginInit();
                page_2.UriSource = new Uri("/Image/training/2/hare.png", UriKind.Relative);
                page_2.EndInit();
                page_3.BeginInit();
                page_3.UriSource = new Uri("/Image/training/3/fox.png", UriKind.Relative);
                page_3.EndInit();
                food_img_1.BeginInit();
                food_img_1.UriSource = new Uri("/Image/food/morkov.png", UriKind.Relative);
                food_img_1.EndInit();
                food_img_2.BeginInit();
                food_img_2.UriSource = new Uri("/Image/food/seno.png", UriKind.Relative);
                food_img_2.EndInit();
                food_img_3.BeginInit();
                food_img_3.UriSource = new Uri("/Image/food/rastenia.png", UriKind.Relative);
                food_img_3.EndInit();
                Animation_Animal = (Storyboard)FindResource("hare");

                src = ResourceController.GetResourceBitmap("/Image/CmpGM/AnimalChildren/hare.png");
                break;
            }

            case (6):
            {
                page_1.BeginInit();
                page_1.UriSource = new Uri("/Image/training/1/hedgehog.png", UriKind.Relative);
                page_1.EndInit();
                page_2.BeginInit();
                page_2.UriSource = new Uri("/Image/training/2/hedgehog.png", UriKind.Relative);
                page_2.EndInit();
                page_3.BeginInit();
                page_3.UriSource = new Uri("/Image/training/3/fox.png", UriKind.Relative);
                page_3.EndInit();
                food_img_1.BeginInit();
                food_img_1.UriSource = new Uri("/Image/food/жук.png", UriKind.Relative);
                food_img_1.EndInit();
                food_img_2.BeginInit();
                food_img_2.UriSource = new Uri("/Image/food/улитка.png", UriKind.Relative);
                food_img_2.EndInit();
                food_img_3.BeginInit();
                food_img_3.UriSource = new Uri("/Image/food/черви.png", UriKind.Relative);
                food_img_3.EndInit();
                Animation_Animal = (Storyboard)FindResource("hedgehog");

                src = ResourceController.GetResourceBitmap("/Image/CmpGM/AnimalChildren/hedgehog.png");
                break;
            }

            case (7):
            {
                page_1.BeginInit();
                page_1.UriSource = new Uri("/Image/training/1/squirrel.png", UriKind.Relative);
                page_1.EndInit();
                page_2.BeginInit();
                page_2.UriSource = new Uri("/Image/training/2/squirrel.png", UriKind.Relative);
                page_2.EndInit();
                page_3.BeginInit();
                page_3.UriSource = new Uri("/Image/training/3/fox.png", UriKind.Relative);
                page_3.EndInit();
                food_img_1.BeginInit();
                food_img_1.UriSource = new Uri("/Image/food/жук.png", UriKind.Relative);
                food_img_1.EndInit();
                food_img_2.BeginInit();
                food_img_2.UriSource = new Uri("/Image/food/грызун.png", UriKind.Relative);
                food_img_2.EndInit();
                food_img_3.BeginInit();
                food_img_3.UriSource = new Uri("/Image/food/ягоды.png", UriKind.Relative);
                food_img_3.EndInit();
                Animation_Animal = (Storyboard)FindResource("squirrel");

                src = ResourceController.GetResourceBitmap("/Image/CmpGM/AnimalChildren/squirrel.png");
                break;
            }

            case (8):
            {
                page_1.BeginInit();
                page_1.UriSource = new Uri("/Image/training/1/elk.png", UriKind.Relative);
                page_1.EndInit();
                page_2.BeginInit();
                page_2.UriSource = new Uri("/Image/training/2/elk.png", UriKind.Relative);
                page_2.EndInit();
                page_3.BeginInit();
                page_3.UriSource = new Uri("/Image/training/3/fox.png", UriKind.Relative);
                page_3.EndInit();
                food_img_1.BeginInit();
                food_img_1.UriSource = new Uri("/Image/food/жук.png", UriKind.Relative);
                food_img_1.EndInit();
                food_img_2.BeginInit();
                food_img_2.UriSource = new Uri("/Image/food/грызун.png", UriKind.Relative);
                food_img_2.EndInit();
                food_img_3.BeginInit();
                food_img_3.UriSource = new Uri("/Image/food/ягоды.png", UriKind.Relative);
                food_img_3.EndInit();
                Animation_Animal = (Storyboard)FindResource("elk");

                src = ResourceController.GetResourceBitmap("/Image/CmpGM/AnimalChildren/elk.png");
                break;
            }
            }
            last          = food_img_2;
            img_1.Source  = page_1;
            img_2.Source  = page_2;
            img_3.Source  = page_3;
            food_1.Source = food_img_1;
            food_2.Source = food_img_2;
            food_3.Source = food_img_3;
            Animation_Animal.Begin(this);
        }