コード例 #1
0
        public void highlightsubmenue(int navsubframekey)
        {
            DoubleAnimation opaout = new DoubleAnimation()
            {
                From     = 1,
                To       = 0,
                Duration = TimeSpan.FromMilliseconds(500)
            };
            DoubleAnimation opain = new DoubleAnimation()
            {
                From     = 0,
                To       = 1,
                Duration = TimeSpan.FromMilliseconds(500)
            };

            Debug.Print("Aminations built for Navigation Highlighter");
            switch (navsubframekey) //mainframekey: 1 is ziel, 2 is letzte ziele, 3 is POI, 4 is MapTanken
            {
            case 1:                 //Ziel

                Address.BeginAnimation(DropShadowEffect.OpacityProperty, opain);

                if (FuelMap.Opacity == 0)
                {
                    FuelMap.BeginAnimation(DropShadowEffect.OpacityProperty, opaout);
                    Debug.Print("nav highlighter if 1 called");
                }
                if (Recent.Opacity == 1)
                {
                    Recent.BeginAnimation(DropShadowEffect.OpacityProperty, opaout);
                    Debug.Print("nav highligther if 2 called");
                }

                Debug.Print("Case 1 called");
                break;

            case 2:     //Recent
                Recent.BeginAnimation(DropShadowEffect.OpacityProperty, opain);

                if (Address.Opacity == 1)
                {
                    Address.BeginAnimation(DropShadowEffect.OpacityProperty, opaout);
                }
                if (POI.Opacity == 0)
                {
                    POI.BeginAnimation(DropShadowEffect.OpacityProperty, opaout);
                }
                Debug.Print("Case 2 called");
                break;

            case 3:     //POI
                POI.BeginAnimation(DropShadowEffect.OpacityProperty, opain);

                if (Recent.Opacity == 0)
                {
                    Recent.BeginAnimation(DropShadowEffect.OpacityProperty, opaout);
                }
                if (FuelMap.Opacity == 0)
                {
                    FuelMap.BeginAnimation(DropShadowEffect.OpacityProperty, opaout);
                }
                Debug.Print("Case 3 called");
                break;

            case 4:     //FuelMap
                FuelMap.BeginAnimation(DropShadowEffect.OpacityProperty, opain);

                if (POI.Opacity == 0)
                {
                    POI.BeginAnimation(DropShadowEffect.OpacityProperty, opaout);
                }
                if (Address.Opacity == 0)
                {
                    Address.BeginAnimation(DropShadowEffect.OpacityProperty, opaout);
                }
                Debug.Print("Case 4 called");
                break;

            default:
                Debug.Print("Default called");
                break;
            }
        }