Пример #1
0
 private async void SlideIn()
 {
     this.Opacity = 1.0;
     Rectangle workingArea = Screen.PrimaryScreen.WorkingArea;
     DoubleAnimation a_top = new DoubleAnimation {
         From = new double?(workingArea.Bottom + this.Height),
         To = new double?((workingArea.Bottom - this.Height) - 5.0),
         Duration = new Duration(TimeSpan.FromSeconds(0.5))
     };
     DoubleAnimation a_bottom = new DoubleAnimation {
         To = new double?((workingArea.Bottom + this.Height) + 5.0),
         Duration = new Duration(TimeSpan.FromSeconds(0.5))
     };
     Storyboard storyboard = new Storyboard();
     storyboard.Children.Add(a_top);
     Storyboard.SetTarget(a_top, this);
     Storyboard.SetTargetProperty(a_top, new PropertyPath(Window.TopProperty));
     await storyboard.BeginAsync();
     await Task.Delay(0xbb8);
     storyboard.Children.Clear();
     storyboard.Children.Add(a_bottom);
     Storyboard.SetTarget(a_bottom, this);
     Storyboard.SetTargetProperty(a_bottom, new PropertyPath(Window.TopProperty));
     await storyboard.BeginAsync();
     this.Close();
 }
Пример #2
0
 private async Task SlideOut()
 {
     this.lvGames.IsHitTestVisible = false;
     ThicknessAnimation a = new ThicknessAnimation {
         From = 0.0,
         To = new Thickness(0.0, this.Height, 0.0, 0.0),
         Duration = new Duration(TimeSpan.FromSeconds(0.5))
     };
     Storyboard storyboard = new Storyboard();
     storyboard.Children.Add(a);
     Storyboard.SetTarget(a, this.lvGames);
     Storyboard.SetTargetProperty(a, new PropertyPath(FrameworkElement.MarginProperty));
     await storyboard.BeginAsync();
     this.lvGames.Visibility = Visibility.Collapsed;
 }