//设置页面控件动画特效
private void setUiAnimation()
{
//控件位置和状态初始化
logoPanel.Margin = new Thickness(left: -210, top: 0, right: 0, bottom: 0);
欢迎使用Panel.Margin = new Thickness(left: 2100, top: 0, right: 0, bottom: 0);
欢迎使用Panel.Opacity = 0;
全自动铝条折弯机Text.Opacity = 0;
渐变直线Border.Opacity = 0;
全自动铝条折弯机Text.Margin = new Thickness(left: -2600, top: 0, right: 0, bottom: 0);
//动画效果设置
//Logo部分动画 >> margin位置渐变
ThicknessAnimation marginAnimation = new ThicknessAnimation();
marginAnimation.To = new Thickness(0, 0, 0, 0);
marginAnimation.Duration = TimeSpan.FromSeconds(0.5);
marginAnimation.BeginTime = TimeSpan.FromSeconds(1);
logoPanel.BeginAnimation(StackPanel.MarginProperty, marginAnimation);
//欢迎使用部分动画 >> margin位置渐变+从不可见到可见
ThicknessAnimation marginAnimation2 = new ThicknessAnimation();
marginAnimation2.To = new Thickness(0, 0, 0, 0);
marginAnimation2.Duration = TimeSpan.FromSeconds(0.5);
marginAnimation2.BeginTime = TimeSpan.FromSeconds(1.5);
欢迎使用Panel.BeginAnimation(TextBox.MarginProperty, marginAnimation2);
DoubleAnimation opacityAnimation2 = new DoubleAnimation(1, TimeSpan.FromSeconds(1));
opacityAnimation2.BeginTime = TimeSpan.FromSeconds(1.5);
Storyboard.SetTarget(opacityAnimation2, 欢迎使用Panel);
Storyboard.SetTargetProperty(opacityAnimation2, new PropertyPath("Opacity"));
//全自动铝条折弯机部分动画 >> margin位置渐变+从不可见到可见
ThicknessAnimation marginAnimation3 = new ThicknessAnimation();
marginAnimation3.To = new Thickness(0, 0, 0, 0);
marginAnimation3.Duration = TimeSpan.FromSeconds(0.5);
marginAnimation3.BeginTime = TimeSpan.FromSeconds(1.5);
全自动铝条折弯机Text.BeginAnimation(TextBlock.MarginProperty, marginAnimation3);
DoubleAnimation opacityAnimation3 = new DoubleAnimation(1, TimeSpan.FromSeconds(1));
opacityAnimation3.BeginTime = TimeSpan.FromSeconds(1.5);
Storyboard.SetTarget(opacityAnimation3, 全自动铝条折弯机Text);
Storyboard.SetTargetProperty(opacityAnimation3, new PropertyPath("Opacity"));
//设置从不可见到可见
// Create a DoubleAnimation to animate the Opacity property
// of the button from 0.0 to 1.0.
DoubleAnimation opacityAnimation = new DoubleAnimation(1, TimeSpan.FromSeconds(1));
opacityAnimation.BeginTime = TimeSpan.FromSeconds(1.5);
// Configure the animation to target "渐变直线Border" and its Opacity property.
Storyboard.SetTarget(opacityAnimation, 渐变直线Border);
Storyboard.SetTargetProperty(opacityAnimation, new PropertyPath("Opacity"));
//添加所有的从不可见到可见到Storyboard
// Create a Storyboard.
Storyboard storyboard = new Storyboard();
// Add the animation to the storyboard and begin playing it.
storyboard.Children.Add(opacityAnimation);
storyboard.Children.Add(opacityAnimation2);
storyboard.Children.Add(opacityAnimation3);
storyboard.Begin();
}