TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Koteswararao Mallisetti
NA
817
564.7k
how to get the stroy board current value in wpf double animation
Nov 4 2010 7:42 AM
hi,
this is koti well i think well known to many users of this site as koteswararao mallisetti here the issue is i am start the one double animation in one button click event it's work file when i stop the animation with another button clik event the animation object get into the original state not in the present state how can we get the current value of the animated object property in the second button click event how to get the current value of that animated object
this is my xaml code:
<Canvas Height="282" Width="286">
<Ellipse Width="20" Height="20" Fill="Blue" Canvas.Left="75" Panel.ZIndex="1" Canvas.Top="12" Name="circ"></Ellipse>
<Rectangle Height="258" Width="164" Fill="Beige" Canvas.Left="12" Canvas.Top="12" Stroke="Brown">
</Rectangle>
<Button Canvas.Left="199" Canvas.Top="85" Height="23" Name="BtnDrop" Width="75" Click="BtnDrop_Click">Start</Button>
<Button Canvas.Left="199" Canvas.Top="136" Height="23" Name="BtnStop" Width="75" Click="BtnStop_Click">Stop</Button>
</Canvas>
.cs file
Storyboard sb = new Storyboard();
public Window1()
{
InitializeComponent();
}
private void BtnDrop_Click(object sender, RoutedEventArgs e)
{
DoubleAnimation drop = new DoubleAnimation(247, new Duration(new TimeSpan(0, 0, 10)));
drop.To = 247;
Storyboard.SetTarget(drop, circ);
Storyboard.SetTargetProperty(drop, new PropertyPath(Canvas.TopProperty));
//Storyboard.SetTargetName(drop,circ.Name );
sb.Children.Add(drop);
sb.Begin();
//sb.BeginAnimation(Canvas.TopProperty , drop);
//circ.BeginAnimation(Canvas.TopProperty, drop);
}
private void BtnStop_Click(object sender, RoutedEventArgs e)
{
Canvas.SetTop(circ,Convert.ToDouble(sb.GetValue(Canvas.TopProperty)));
sb.Stop();
}
}
Reply
Answers (
0
)
Pass textbox value from one form to another form
WPF 3D Flip using forms.