Rotated Element creates issues with adorner
I have a problem with my ado开发者_如何学运维rner 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
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).
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!
精彩评论