Merge
authorsarias
Sun, 11 Oct 2009 20:38:22 +0200
changeset 139 7eb5f979d086
parent 138 61ba19954ed4 (current diff)
parent 137 5a47756f7fb8 (diff)
child 140 fc7c12f9da30
Merge
src/FingersDance/MainSurfaceWindow.xaml
src/FingersDance/MainSurfaceWindow.xaml.cs
--- a/src/FingersDance/MainSurfaceWindow.xaml	Sun Oct 11 20:34:56 2009 +0200
+++ b/src/FingersDance/MainSurfaceWindow.xaml	Sun Oct 11 20:38:22 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,8 +125,11 @@
   		</Setter>
   	</Style>
   </s:SurfaceWindow.Resources>
+	<s:SurfaceWindow.Triggers>
+		<EventTrigger RoutedEvent="FrameworkElement.Loaded"/>
+	</s:SurfaceWindow.Triggers>
 
-  <Grid x:Name="MainGrid" Width="1024" Height="768" Loaded="MainGrid_Loaded" >
+  <Grid x:Name="MainGrid" Width="1024" Height="768" >
   	<Grid.Background>
   		<LinearGradientBrush EndPoint="0.505,0.985" StartPoint="0.505,-0.015">
   			<GradientStop Color="#FF000000" Offset="0"/>
--- a/src/FingersDance/MainSurfaceWindow.xaml.cs	Sun Oct 11 20:34:56 2009 +0200
+++ b/src/FingersDance/MainSurfaceWindow.xaml.cs	Sun Oct 11 20:38:22 2009 +0200
@@ -85,26 +85,6 @@
 
 
         /// <summary>
-        /// CopyTo rotate the layout based on the suggested orientation
-        /// </summary>
-        /// <param name="e"></param>
-        private void MainGrid_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();
-        }
-
-        /// <summary>
         /// Occurs when the window is about to close. 
         /// </summary>
         /// <param name="e"></param>
@@ -146,6 +126,7 @@
         private void OnApplicationActivated(object sender, EventArgs e)
         {
             //TODO: enable audio, animations here
+
         }
 
         /// <summary>
@@ -170,6 +151,29 @@
             //TODO: disable audio, animations here
         }
 
+        /// <summary>
+        ///  This is called when application has been loaded, we change the orientation
+        ///  of the application
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        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)
         {  }