Getting an icon to always be unrotated regardless of parent rotations in WPF

Posted by Jeff Moser on Stack Overflow See other posts from Stack Overflow or by Jeff Moser
Published on 2010-05-24T17:00:49Z Indexed on 2010/05/24 17:11 UTC
Read the original article Hit count: 249

Filed under:

Is there an easy way in WPF to specify the orientation of an icon (or Button, or any WPF object) so that it always effectively remains unrotated regardless of the rotations of the parent transforms?

For example, I'd like to have an icon like this:

+   +   +
+   +
+++++   +
+   +   +
+   +   +

However, if I dock it to the left side, it'd by default look like this:

+++++
  +
  +
  +
+++++

+++ +

and if I docked it to the right, it'd be like this:

+ +++

+++++
  +
  +
  +
+++++

Is there a way to make it always be:

+   +   +
+   +
+++++   +
+   +   +
+   +   +

? I know I could manually track where it's docked and rotate it appropriately, but I was wondering if there's a clever way to effectively give the icon "gravity" to always point down.

Thanks!

© Stack Overflow or respective owner

Related posts about wpf