# HG changeset patch # User sarias # Date 1255284842 -7200 # Node ID 5a47756f7fb8db44fed0ad6c5b5775f22ffe505d # Parent 8d755ba035f967b3fd0d0ab54fcfe44d97d4c3fc To rotate the layout based on the suggested orientation diff -r 8d755ba035f9 -r 5a47756f7fb8 src/FingersDance/MainSurfaceWindow.xaml --- a/src/FingersDance/MainSurfaceWindow.xaml Mon Oct 05 19:27:24 2009 +0200 +++ b/src/FingersDance/MainSurfaceWindow.xaml Sun Oct 11 20:14:02 2009 +0200 @@ -16,7 +16,7 @@ x:Class="FingersDance.SurfaceWindow1" Title="FingersDance" Width="1024" Height="768" x:Name="mainSurfaceWindow" - Background="{x:Null}" + Background="{x:Null}" Loaded="mainSurfaceWindow_Loaded" > @@ -125,6 +125,9 @@ + + + diff -r 8d755ba035f9 -r 5a47756f7fb8 src/FingersDance/MainSurfaceWindow.xaml.cs --- a/src/FingersDance/MainSurfaceWindow.xaml.cs Mon Oct 05 19:27:24 2009 +0200 +++ b/src/FingersDance/MainSurfaceWindow.xaml.cs Sun Oct 11 20:14:02 2009 +0200 @@ -126,6 +126,7 @@ private void OnApplicationActivated(object sender, EventArgs e) { //TODO: enable audio, animations here + } /// @@ -150,6 +151,29 @@ //TODO: disable audio, animations here } + /// + /// This is called when application has been loaded, we change the orientation + /// of the application + /// + /// + /// + private void mainSurfaceWindow_Loaded(object sender, RoutedEventArgs e) + { + + if (ApplicationLauncher.InitialOrientation == UserOrientation.Top) + { + // Rotate the main canvas by 180 degrees. + this.MainGrid.LayoutTransform = new RotateTransform(180.0); + } + else + { + // Remove the rotate transform on the main canvas. + this.MainGrid.LayoutTransform = null; + } + // Dismiss the loading screen. + ApplicationLauncher.SignalApplicationLoadComplete(); + } + private void scaterview_ContactChanged(object sender, ContactEventArgs e) { }