1

I have defined a canvas in XAML that I add a lot of figures to in C#. I've got some pinch going on but need some help applying the scale to the UIElement.

I've created my ScaleTransform like this:

ScaleTransform scaleTrans = new ScaleTransform();
scaleTrans.ScaleX = scaleFactor;
scaleTrans.ScaleY = scaleFactor;

But how can I apply it to my UIElement (the only children of my canvas)?

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
Jason94
  • 13,320
  • 37
  • 106
  • 184

1 Answers1

2

You need to use the UIElement.RenderTransform property :

yourElement.RenderTransform = scaleTrans;
Luke Marlin
  • 1,398
  • 9
  • 26