HerpDerpington
HerpDerpington

Reputation: 4483

Transforming without setting RenderTransform

I'm trying to simply transform a Control but I don't want to use the UIElement.RenderTransform Property as it is possible that this has been set from outside of the Control. Is there another way to do such Transformations on Controls?

Upvotes: 0

Views: 126

Answers (1)

SynerCoder
SynerCoder

Reputation: 12786

Use a TransformGroup to combine your transform with the already set transform.

var currentTransform = this.RenderTransform;
var myTransform = new RotateTransForm()
{
    Angle = 90
};
var group = new TransformGroup();
group.Children.Add(currentTransform);
group.Children.Add(myTransform);

this.RenderTransform = group;

Upvotes: 3

Related Questions