WPF代码方式添加的控件用Storyboard解决办法

WPF代码方式添加的控件用Storyboard
如题,我写了一个简单的测试Demo,新建一个wpf项目,主窗口中添加Canvas控件

<Window x:Class="StoryBoardTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Canvas Name="TestCanvas">
            <Button Content="Button" Canvas.Left="19" Canvas.Top="20" Width="75" Click="Button_Click_1"/>
        </Canvas>
    </Grid>
</Window>


想要实现的效果是点击按钮后添加一个新的button ,并且用动画显示出来 ,代码如下:

        private void Button_Click_1(object sender, RoutedEventArgs e) //button1点击响应函数
        {
            //手动定义一个NewButton
            Button button = new Button();
            button.Width = 70;
            button.Height = 20;

            //定义Button 的名称
            button.Name = "ButtonTest";

            //设置button 在Canvas中的位置
            Canvas.SetLeft(button, 19);
            Canvas.SetTop(button, 50);

            //添加按钮到Canvas
            TestCanvas.Children.Add(button);

            //设置动画
            SetStoryboard(button);
        }

        private void SetStoryboard(Button button)
        {
            //动画定义
            Storyboard myStoryboard = new Storyboard();

            //透明度由0-1的变化动画 
            DoubleAnimation OpacityDoubleAnimation = new DoubleAnimation();
            OpacityDoubleAnimation.From = 0;
            OpacityDoubleAnimation.To = 1;
            OpacityDoubleAnimation.Duration = new Duration(TimeSpan.FromSeconds(1.4));

            //设置动画对象名称
            Storyboard.SetTargetName(OpacityDoubleAnimation, button.Name);

            //设置动画属性
            Storyboard.SetTargetProperty(OpacityDoubleAnimation, new PropertyPath(Grid.OpacityProperty));
            myStoryboard.Children.Add(OpacityDoubleAnimation);

            //开始动画
            myStoryboard.Begin(TestCanvas);
        }


运行时提示错误:无法在“System.Windows.Controls.Canvas”的名称领域内找到“ButtonTest”名称。哪位可以帮我看看问题出在哪儿?
------解决方案--------------------
两种改法:

//一:
//定义Button 的名称
button.Name = "ButtonTest";
this.RegisterName(button.Name, button);  // 加这行,登记名字 

//或者二:
//设置动画对象 ,而不是用名字
 Storyboard.SetTarget(OpacityDoubleAnimation, button);