In the WP50 silverlight application, I wanted to use storyboard animation on a specific event. The animation changes the button height property from x to y points (changed for the request).
I use the code below 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 click Unable to solve the problem named TargetName1
Is there any easy solution for my problem?
source share