Exemple #1
0
        private void ShowSavegames(bool animate)
        {
            SaveListPanel.Visibility = Visibility.Visible;
            if (animate)
            {
                SaveListPanel.BeginAnimation(DockPanel.OpacityProperty, null);
                var anim = new DoubleAnimation(0, 2, new Duration(TimeSpan.FromSeconds(0.1)))
                {
                    DecelerationRatio = 1
                };
                SaveListPanel.BeginAnimation(DockPanel.OpacityProperty, anim);

                var blur = new BlurEffect
                {
                    RenderingBias = RenderingBias.Quality,
                    Radius        = 30
                };

                SaveListPanel.Effect = blur;

                var anim0 = new DoubleAnimation(10, 0, new Duration(TimeSpan.FromSeconds(0.5)))
                {
                    DecelerationRatio = 1
                };
                anim0.Completed += (object sender, EventArgs e) =>
                {
                    SaveListPanel.Effect = null;
                };
                blur.BeginAnimation(BlurEffect.RadiusProperty, anim0);
            }
        }
Exemple #2
0
 private void ProfileChanged(bool animate)
 {
     if (animate)
     {
         SaveListPanel.BeginAnimation(DockPanel.OpacityProperty, null);
         var anim = new DoubleAnimation(1, 0, new Duration(TimeSpan.FromSeconds(0.1)))
         {
             AccelerationRatio = 1
         };
         anim.Completed += (object sender, EventArgs e) =>
         {
             SaveListPanel.Visibility = Visibility.Hidden;
             SaveInfo.Visibility      = Visibility.Collapsed;
         };
         SaveListPanel.BeginAnimation(DockPanel.OpacityProperty, anim);
     }
     else
     {
         SaveListPanel.Visibility = Visibility.Hidden;
         SaveInfo.Visibility      = Visibility.Collapsed;
     }
     SavegameChanged(animate);
 }