Rotated Element creates issues with adorner

1k views Asked by At

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

2

There are 2 answers

0
raphi011 On BEST ANSWER

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!

1
NVM On

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).