/// <summary>
        /// 隐藏当前三级界面
        /// </summary>
        /// <param name="duration"></param>
        public void AnimateOut(Duration duration)
        {
            var sb = new Storyboard();

            var animateOpacity = new DoubleAnimation(0, duration);

            Storyboard.SetTarget(animateOpacity, this);
            Storyboard.SetTargetProperty(animateOpacity, new PropertyPath("Opacity"));
            sb.Children.Add(animateOpacity);
            sb.FillBehavior       = FillBehavior.Stop;
            this.IsHitTestVisible = false;
            sb.Begin();
            SpeechMediaElement.Stop();
            SpeechMediaElement.Source = null;
        }
Example #2
0
        private void ShowIntro()
        {
            SpeechMediaElement.Stop();
            SpeechMediaElement.Source = null;
            京剧文字底.Visibility          = Visibility.Hidden;
            京剧1.Visibility            = Visibility.Hidden;
            越剧文字底.Visibility          = Visibility.Hidden;
            越剧1.Visibility            = Visibility.Hidden;
            // hide this screen and show the intro screen
            var animateOpacity = new DoubleAnimation(1, 0, TimeSpan.FromMilliseconds(500));

            animateOpacity.Completed += (o, e) =>
            {
                var mainWin = Application.Current.MainWindow as MainWindow;
                mainWin.ShowIntro();
                mainWin.VolumeUp();
                this.IsHitTestVisible = false;
                this.Visibility       = Visibility.Collapsed;
            };
            this.BeginAnimation(CategorySelectionControl3.OpacityProperty, animateOpacity);
        }
 public void AllStop()
 {
     SpeechMediaElement.Stop();
     SpeechMediaElement.Source = null;
 }