Пример #1
0
        void HideGameMenu(double menuFadeOutTime = 2.0, double gameFadeInTime = 1.0)
        {
            DoubleAnimation fadeOut = new DoubleAnimation(0.0, TimeSpan.FromSeconds(menuFadeOutTime));

            DoubleAnimation fadeIn = new DoubleAnimation(1.0, TimeSpan.FromSeconds(gameFadeInTime));

            fadeIn.BeginTime = TimeSpan.FromSeconds(menuFadeOutTime);

            GameCanvas.BeginAnimation(UIElement.OpacityProperty, fadeIn);
            gameMenuControl.BeginAnimation(UIElement.OpacityProperty, fadeOut);

            gameMenuControl.IsHitTestVisible = false;
        }
Пример #2
0
        void ShowGameMenu(object header, object message, double gameFadeOutTime = 2.0, double menuFadeInTime = 1.0)
        {
            DoubleAnimation fadeOut = new DoubleAnimation(0.0, TimeSpan.FromSeconds(gameFadeOutTime));

            DoubleAnimation fadeIn = new DoubleAnimation(1.0, TimeSpan.FromSeconds(menuFadeInTime));

            fadeIn.BeginTime = TimeSpan.FromSeconds(gameFadeOutTime);

            GameCanvas.BeginAnimation(UIElement.OpacityProperty, fadeOut);
            gameMenuControl.BeginAnimation(UIElement.OpacityProperty, fadeIn);

            gameMenuControl.SetHeader(header);
            gameMenuControl.SetMessage(message);

            gameMenuControl.IsHitTestVisible = true;
        }