title: How to rotate, translate and scale a control object around an specific point in WPF
body: <p>I have a custom built control, which is a rectangle with a few details inside it, but it is a rectangle.</p>
  
  <p>I have a center point (X,Y), which I call "Center of Gravity", which "represents" the point. This means that when I set a new position to the object, I want this point to be in the set position. When I rotate the object, I need it to rotate around this point. And when I scale the object, the point must remain in the position set before. Only the size of the object must change.</p>
  
  <p>For example, to have an easy picture of the problem, let's say I have a 10X10 square. I set the center of the gravity in the exact center of the square: (5,5). Then I set the objects position to (100, 100). Then, the square would be in:</p>
  
  <p>(95,95), (105,95), (105,105), (95,105), which means its center would be in the desired position.</p>
  
  <p>In case I scale the square with value 2, the new 4 points positions would be:</p>
  
  <p>(90,90), (110,90), (110,110), (90,110), which means its center would remain in the desired position.</p>
  
  <p>In case I rotate it 45 degrees, it would rotate around its center with positions:</p>
  
  <p>(92.93,92.93),(107.07,92.93),(107.07,107.07),(92.93,107.07)</p>
  
  <p>How is it possible to do this, with its center fully configurable and all this transforms to be transparent for the program in WPF? I would like only to set Scale, Position, Rotation Angle and center to have it drawn properly.</p>
  
  <p>Thank you!</p>