1

I have a problem with my adorner which is supposed to preview the destination of my drag & drop operation,

everything is working fine until i rotate the adorned element.

My adorner is a rectangle which is filled with a visual brush of the adorned element, so if the element is rotated the adorner gets the correct (already rotated) image. But because the rectangle has to be rotated too the image gets rotated once more which isn't supposed to happen. Can I somehow exclude the brush of the transformation so it will not rotate again or is there another solution for my problem?

Thanks

skaffman
  • 398,947
  • 96
  • 818
  • 769
raphi011
  • 502
  • 1
  • 6
  • 23

2 Answers2

0

You can override the GetDesiredTransform method in the adorner class and manipulate the transforms applied to the adorner's children (the rectangle with the visual brush in your case).

NVM
  • 5,442
  • 4
  • 41
  • 61
  • Yes, the problem is i want the Rectangle to be rotated but the brush to remain the same, the adorner gets the brush from the previously rotated UIElement and rotates it again. Know what i mean? – raphi011 Feb 07 '11 at 14:29
0

Finally I have a solution to this problem: with this small algorythm link I've created a copy of the UI element, set its rendertransform property to null and used it as a visualbrush instead of the original element which also allowed me to set the original element to invisible!

raphi011
  • 502
  • 1
  • 6
  • 23