I want to make a copy of the Element that has the new properties based upon the RenderTransform. For example, a ScaleTransform of an element on one canvas to another canvas.
private void CopyElement(UIElement elem, Canvas src, Canvas dest, Size scale, Vector offset) {
ScaleTransform resize = new ScaleTransform(scale.Width, scale.Height);
elem.LayoutTransform = resize;
UIElement newElem = CopyElement(src, elem);
Canvas.SetLeft(newElem, Canvas.GetLeft(elem) * scale.Width + offSet.X);
Canvas.SetTop(newElem, Canvas.GetTop(elem) * scale.Height + offSet.Y);
dest.Children.Add(newElem);
}
You don't need to do this at all.
Just set the element's LayoutTransform
property instead of its RenderTransform
.