Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Finding a RotateTransform somewhere in the visual tree

 
 
Old 05-10-2007   #1 (permalink)
Andrew Whiddett \(Home\)


 
 

Finding a RotateTransform somewhere in the visual tree

I need to find out the rotate transform applied from a low level part of the
tree, e.g.

Lets say I have the following:

<StackPanel x:Name="commonpanel">
<StackPanel x:Name="foo1">
<StackPanel.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1"/>
<SkewTransform AngleX="0" AngleY="0"/>
<RotateTransform Angle="90"/>
<TranslateTransform X="0" Y="0"/>
</TransformGroup>
</StackPanel.RenderTransform>
<TextBlock x:Name="textFoo1">Foo1</TextBlock>
</StackPanel>
<StackPanel x:Name="foo2">
<StackPanel.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1"/>
<SkewTransform AngleX="0" AngleY="0"/>
<RotateTransform Angle="180"/>
<TranslateTransform X="0" Y="0"/>
</TransformGroup>
</StackPanel.RenderTransform>
<TextBlock x:Name="textFoo2">Foo2</TextBlock>
</StackPanel>
</StackPanel>

In my case I need to find the current angle of the 'textFoo1' & 'textFoo2'
visual elements, in relation to the 'commonpanel' visual element.

textFoo1.TransformToAncestor(commonpanel) does not seem to help as it
returns a GeneralTransform.. The code that needs to do this is generic, I.e.
The StackPanel/Angle etc might not exist at all.

Any ideas ?

Regards

Andrew



My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Err.Number 486, Vista Ultimate, Visual Studio, & Visual Basic Vista General
Running Visual C++ and/or Visual Basic under Vista Home Premium OS Vista General
Tree PowerShell
Visual Studio 6 and Visual Source Safe 6 on Vista Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46