本文整理汇总了C#中System.Windows.Media.Animation.DoubleAnimation.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# DoubleAnimation.Clone方法的具体用法?C# DoubleAnimation.Clone怎么用?C# DoubleAnimation.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Animation.DoubleAnimation
的用法示例。
在下文中一共展示了DoubleAnimation.Clone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MetroTile
public MetroTile()
{
InitializeComponent();
TimeSpan d = TimeSpan.FromMilliseconds(200);
Storyboard sb = new Storyboard() { Duration = d };
DoubleAnimation da = new DoubleAnimation() { Duration = d };
Storyboard.SetTarget(da, grr);
Storyboard.SetTargetProperty(da, new PropertyPath(Grid.OpacityProperty));
bool cl = false;
sb.Completed += delegate(object s, EventArgs e) { if (cl) OnClick(); };
grr.MouseLeftButtonUp += delegate(object s, System.Windows.Input.MouseButtonEventArgs e)
{
TimeSpan d1 = TimeSpan.FromMilliseconds(d.TotalMilliseconds / 3);
TimeSpan d2 = TimeSpan.FromMilliseconds((d.TotalMilliseconds / 3) * 2);
DoubleAnimation da1 = da.Clone();
da1.To = 1;
da1.Duration = d1;
DoubleAnimation da2 = da.Clone();
da2.To = 0;
da2.BeginTime = d1;
da2.Duration = d2;
sb.Children.Clear();
sb.Children.Add(da1);
sb.Children.Add(da2);
sb.Begin();
cl = true;
};
grr.MouseEnter += delegate(object s, System.Windows.Input.MouseEventArgs e)
{
da.To = 0.2f;
sb.Children.Clear();
sb.Children.Add(da);
sb.Begin();
cl = false;
};
grr.MouseLeave += delegate(object s, System.Windows.Input.MouseEventArgs e)
{
da.To = 0;
sb.Children.Clear();
sb.Children.Add(da);
sb.Begin();
cl = false;
};
}