DoubleAnimation doubleAnimation = new DoubleAnimation(1, 0, new Duration(TimeSpan.FromSeconds(2)));
storyboard.Children.Add(doubleAnimation);//添加仅故事板
Storyboard.SetTarget(doubleAnimation, notify);//设置目标
Storyboard.SetTargetProperty(doubleAnimation, new PropertyPath(StackPanel.OpacityProperty)); //设置目标依赖项属性
storyboard.Begin(notify, HandoffBehavior.SnapshotAndReplace);//开始动画