In WP7 silverlight app, i wanted to use a storyboard animation on a particular event. The animation is changing button height property from x to y points (changed for query).
I am using below code in my program
Storyboard myStoryBoard = new Storyboard();
myStoryBoard.Duration = new Duration(TimeSpan.FromMilliseconds(200));
DoubleAnimation myDoubleAnimation = new DoubleAnimation();
Storyboard.SetTargetName(myDoubleAnimation, button1.Name); // button1 is normal button on UI
Storyboard.SetTargetProperty(myDoubleAnimation, new PropertyPath(Button.HeightProperty));
myDoubleAnimation.From = 200;
myDoubleAnimation.To = 300;
myStoryBoard.Children.Add(myDoubleAnimation);
myStoryBoard.Begin();
when i run my code, i am hitting with Cannot resolve TargetName button1 error
any easy fix for my issue?