Applying multiple transforms to a UI element
===

I am new to WP7 / Silverlight / C# programming and I'm currently putting together a simple magnifying app to get to grips with a few things. In order to provide 'zoom in' and 'zoom out' functionality I successfully managed to use a ScaleTransform on the UIElement which contains the video feed.

As I have developed the app further I realised that I want to accomodate the orientation changing during the use of the app and ensure that the video feed responds accordingly (The app is fixed in landscape mode but a user may want to 'turn the phone over' for some reason). To address this I created and applied a RotateTransform and linked into the OrientationChanged event.

All of this works fine but when I try to zoom (using the ScaleTransform) after I have changed the orientation then the video feed zooms but flips the feed back to the 'default' orientation and therefore show upside down.

Given this I figured I needed to apply both transforms when zooming in, so I created a TransformGroup and added the ScaleTransform and RotateTransform to it. However the zoom function will not work with this and none of the transform's appear to be applied.

Has anybody else encountered problems when trying to apply a TransformGroup?

I've included a snippet of the zoom in and orientation code below for reference - apologies in advance if I am doing things the long way round but bear in mind I'm still learning.

Any help would be appreciated.
Thanks in advance,
Craig.

    UIElement videocontainer;
    RotateTransform rotatetransform = new RotateTransform();
    
    void MainPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
    		{
    			switch (Orientation)
    			{
    				case PageOrientation.LandscapeLeft:
    					rotatetransform.Angle = 0;
    					break;
    				default:
    					rotatetransform.Angle = 180;
    					break;
    			}
    			rotatetransform.CenterX = 320;
    			rotatetransform.CenterY = 240;
    			videocontainer.RenderTransform = rotatetransform;
    
    private void ZoomIn_Click(object sender, EventArgs e)
    		{
    			if (zoom < 7)
    			{
                    switch (Orientation)
                    {
                        case PageOrientation.LandscapeLeft:
                            ScaleTransform myscaletransform1 = new ScaleTransform();
                            myscaletransform1.ScaleX = myscaletransform1.ScaleX * 1.25;
                            myscaletransform1.ScaleY = myscaletransform1.ScaleY * 1.25;
                            myscaletransform1.CenterX = 320;
                            myscaletransform1.CenterY = 240;
                            TransformGroup zoomintranformgroup1 = new TransformGroup();
                            zoomintranformgroup1.Children.Add(myscaletransform1);
                            zoomintranformgroup1.Children.Add(rotatetransform);
                            videocontainer.RenderTransform = zoomintransformgroup1;
                            zoom++;
                            break;
                        default:
                            ScaleTransform myscaletransform2 = new ScaleTransform();
                            myscaletransform2.ScaleX = myscaletransform2.ScaleX * 1.25;
                            myscaletransform2.ScaleY = myscaletransform2.ScaleY * 1.25;
                            myscaletransform2.CenterX = 320;
                            myscaletransform2.CenterY = 240;
                            TransformGroup zoomintranformgroup2 = new TransformGroup();
                            zoomintranformgroup2.Children.Add(myscaletransform2);
                            zoomintranformgroup2.Children.Add(rotatetransform);
                            videocontainer.RenderTransform = zoomintransformgroup2;
                            zoom++;
                            break;
                    }
    
    				
    			}
    			else
    			{
    				return;
    			}
    		}