i want to use animation to move an object in WPF
.
what i know to do that is From
and To
property
but its not working because they take type double and Margin is type Thickness.
i also used SetValue
as u see
DoubleAnimation lockation = new DoubleAnimation();
lockation.SetValue(MarginProperty, new Thickness(423, 219, -5, -5));
lockation.Duration = new Duration(TimeSpan.FromMilliseconds(100));
image.BeginAnimation(Image.MarginProperty, lockation);
but its not working too. what should i do?