I have applied TranslateTransform on a control, but the control’s margin remains the same.
var margin = this.Margin;
this.RenderTransform = new TranslateTransform(diff.X, diff.Y);
if (diff.X != 0 && diff.Y != 0)
{
if (margin == this.Margin)
MessageBox.Show("Margins are equal");
}
I want margin to be “updated” after Transform. How can I do that?
You can’t do it automatically, because
RenderTransformwill not affect any Layout properties.From MSDN
And you can’t use a
LayoutTransforminstead.