Answer the question
In order to leave comments, you need to log in
Why doesn't the Margin of the button change?
There is a code:
Button btn = (Button)sender;
btn.Margin = new Thickness();
Thickness margin = btn.Margin;
ThicknessAnimation anim = new ThicknessAnimation();
...
Answer the question
In order to leave comments, you need to log in
Probably something like ThicknessAnimation is changing the Margin of the button.
You need to remove the animation before making changes:
Button btn = (Button)sender;
button.BeginAnimation(MarginProperty, null);
btn.Margin = new Thickness();
Thickness margin = btn.Margin;
// ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question