当前位置: 首页>>代码示例>>C#>>正文


C# Storyboard.BeginAsync方法代码示例

本文整理汇总了C#中System.Windows.Media.Animation.Storyboard.BeginAsync方法的典型用法代码示例。如果您正苦于以下问题:C# Storyboard.BeginAsync方法的具体用法?C# Storyboard.BeginAsync怎么用?C# Storyboard.BeginAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Media.Animation.Storyboard的用法示例。


在下文中一共展示了Storyboard.BeginAsync方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SlideIn

 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();
 }
开发者ID:CyberFoxHax,项目名称:PCSXBonus,代码行数:26,代码来源:wndGameNotify.cs

示例2: SlideOut

 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;
 }
开发者ID:CyberFoxHax,项目名称:PCSXBonus,代码行数:15,代码来源:MainWindow.cs


注:本文中的System.Windows.Media.Animation.Storyboard.BeginAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。