Search code examples
wpfdrag-and-dropadornervisualbrushrotatetransform

Rotated Element creates issues with adorner


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


Solution

  • 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!