Projet Menu avec profondeur complete.
authorsarias
Fri, 31 Jul 2009 00:45:42 +0200
changeset 3 4f1ea403073d
parent 2 06de3a61998f
child 4 7b7f95dc9027
Projet Menu avec profondeur complete. Projet Player sans design play pause basique Les deux projets ont un Surface[name]Test.xaml & .cs pour montrer les fonctionalites. (pour tester il faut "set up as start up project")
src/FingersDance.Control.Menu/UserControlMenu.xaml
src/FingersDance.Control.Menu/UserControlMenu.xaml.cs
src/FingersDance.Control.Player/App.xaml
src/FingersDance.Control.Player/FingersDance.Control.Player.csproj
src/FingersDance.Control.Player/Lake.wmv
src/FingersDance.Control.Player/Properties/Resources.Designer.cs
src/FingersDance.Control.Player/Properties/Resources.resx
src/FingersDance.Control.Player/Resources/Butterfly.wmv
src/FingersDance.Control.Player/Resources/Lake.wmv
src/FingersDance.Control.Player/SurfacePlayerTest.xaml
src/FingersDance.Control.Player/SurfacePlayerTest.xaml.cs
src/FingersDance.Control.Player/SurfaceWindow1.xaml
src/FingersDance.Control.Player/SurfaceWindow1.xaml.cs
src/FingersDance.Control.Player/UserControlPlayer.xaml
src/FingersDance.Control.Player/UserControlPlayer.xaml.cs
--- a/src/FingersDance.Control.Menu/UserControlMenu.xaml	Wed Jul 29 00:55:57 2009 +0200
+++ b/src/FingersDance.Control.Menu/UserControlMenu.xaml	Fri Jul 31 00:45:42 2009 +0200
@@ -27,8 +27,26 @@
 					<TranslateTransform X="0" Y="0"/>
 				</TransformGroup>
 			</StackPanel.RenderTransform>
-			<Custom:SurfaceButton FontSize="14" FontWeight="Normal" Foreground="#FFAEAEAE" Width="Auto" Height="25" Content="Cinématographique" Visibility="Visible" Background="#72FFFFFF" x:Name="ButtonChildCine"/>
-			<Custom:SurfaceButton FontSize="14" FontWeight="Normal" Foreground="#FFAEAEAE" Width="Auto" Height="26" Content="Chorégraphique" Background="#72FFFFFF" Visibility="Visible" x:Name="ButtonChildChore"/>
+			<Custom:SurfaceButton FontSize="14" FontWeight="Normal" Foreground="#FFAEAEAE" Width="Auto" Height="25" Content="Cinématographique" Visibility="Visible" Background="#72FFFFFF" x:Name="ButtonChildCine" ContactDown="ButtonChildCine_ContactDown" Click="ButtonChildCine_Click"/>
+			<StackPanel x:Name="PanelChildCine" Width="Auto" Height="Auto" Visibility="Collapsed" HorizontalAlignment="Right" Background="{x:Null}">
+				<Custom:SurfaceButton Height="25" Content="Mouvement de Caméra" x:Name="ButtonChild1MouvCam" Click="ButtonChild1MouvCam_Click" ContactDown="ButtonChild1MouvCam_ContactDown"/>
+				<StackPanel x:Name="PanelChild1MouvCam" Height="Auto" Visibility="Collapsed" HorizontalAlignment="Right">
+					<Custom:SurfaceButton Content="MouvCam1" x:Name="buttonMouvCam1"/>
+					<Custom:SurfaceButton Content="MouvCam2" x:Name="bouttonMouvCam2"/>
+				</StackPanel>
+				<Custom:SurfaceButton Height="25" Content="Axe de Caméra" x:Name="buttonChild1AxeCam" Click="buttonChild1AxeCam_Click" ContactDown="buttonChild1AxeCam_ContactDown"/>
+				<StackPanel x:Name="PanelChild1AxeCam" Height="Auto" Visibility="Collapsed" HorizontalAlignment="Right">
+					<Custom:SurfaceButton Content="Axe camèra1" x:Name="buttonAxeCam1"/>
+					<Custom:SurfaceButton Content="Axe camèra2" x:Name="buttonAxeCam2"/>
+					<Custom:SurfaceButton Content="Axe camèra3" x:Name="buttonAxeCam3"/>
+					<Custom:SurfaceButton Content="Axe camèra4" x:Name="buttonAxeCam4"/>
+				</StackPanel>
+			</StackPanel>
+			<Custom:SurfaceButton FontSize="14" FontWeight="Normal" Foreground="#FFAEAEAE" Width="Auto" Height="26" Content="Chorégraphique" Background="#72FFFFFF" Visibility="Visible" x:Name="ButtonChildChore" Click="ButtonChildChore_Click" ContactDown="ButtonChildChore_ContactDown"/>
+			<StackPanel x:Name="PanelChildChore" Width="Auto" Height="Auto" Visibility="Collapsed" HorizontalAlignment="Right" Background="#FFA6A6A6">
+				<Custom:SurfaceButton Content="ChildChore1" x:Name="button1"/>
+				<Custom:SurfaceButton Content="ChildChore2" x:Name="button2"/>
+			</StackPanel>
 		</StackPanel>
 		<Custom:SurfaceButton FontSize="18" FontWeight="Normal" Foreground="#FFAEAEAE" x:Name="ButtonRecherche" Width="Auto" Height="45" Content="Recherche" ContactDown="ButtonRecherche_ContactDown" Click="ButtonRecherche_Click"/>
 		<StackPanel Visibility="Collapsed" HorizontalAlignment="Right" x:Name="PanelRecherche" Width="262" Height="45"/>
--- a/src/FingersDance.Control.Menu/UserControlMenu.xaml.cs	Wed Jul 29 00:55:57 2009 +0200
+++ b/src/FingersDance.Control.Menu/UserControlMenu.xaml.cs	Fri Jul 31 00:45:42 2009 +0200
@@ -23,10 +23,19 @@
         //Premet de deplacer les sous menus vers la droite pour avoir un effect tree view
          private void initChildSize()
         {
-            PanelAnnotation.Width -= 0.20*this.Width;
-            PanelRecherche.Width -= 0.20 * this.Width;
+             //Niveau 1
+            PanelAnnotation.Width -= 0.10*this.Width;
+            PanelRecherche.Width -= 0.10 * this.Width;
+             //Niveau 2
+            PanelChildChore.Width -= 0.10 * this.Width;
+            PanelChildCine.Width -= 0.10 * this.Width;
+             //Niveau 3
+            PanelChild1AxeCam.Width -= 0.05 * this.Width;
+            PanelChild1MouvCam.Width -= 0.05 * this.Width;
         }
 
+         #region Events
+         //Annotation
         private void ButtonAnnotation_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
         {
             if (PanelAnnotation.Visibility == Visibility.Collapsed)
@@ -39,6 +48,18 @@
             }
         }
 
+        private void ButtonAnnotation_Click(object sender, RoutedEventArgs e)
+        {
+            if (PanelAnnotation.Visibility == Visibility.Collapsed)
+            {
+                PanelAnnotation.Visibility = Visibility.Visible;
+            }
+            else
+            {
+                PanelAnnotation.Visibility = Visibility.Collapsed;
+            }
+        }
+        //Recherche
         private void ButtonRecherche_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
         {
             if (PanelRecherche.Visibility == Visibility.Collapsed)
@@ -49,20 +70,8 @@
             {
                 PanelRecherche.Visibility = Visibility.Collapsed;
             }
-        }
-
-        private void ButtonAnnotation_Click(object sender, RoutedEventArgs e)
-        {
-            if (PanelAnnotation.Visibility == Visibility.Collapsed)
-            {
-                PanelAnnotation.Visibility = Visibility.Visible;
-            }
-            else
-            {
-                PanelAnnotation.Visibility = Visibility.Collapsed;
-            } 
-        }
-
+        }           
+        
         private void ButtonRecherche_Click(object sender, RoutedEventArgs e)
         {
             if (PanelRecherche.Visibility == Visibility.Collapsed)
@@ -74,5 +83,104 @@
                 PanelRecherche.Visibility = Visibility.Collapsed;
             }
         }
-	}
+        //ChildCine
+        private void ButtonChildCine_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
+        {
+            if (PanelChildCine.Visibility == Visibility.Collapsed)
+            {
+                PanelChildCine.Visibility = Visibility.Visible;
+            }
+            else
+            {
+                PanelChildCine.Visibility = Visibility.Collapsed;
+            } 
+        }
+
+        private void ButtonChildCine_Click(object sender, RoutedEventArgs e)
+        {
+            if (PanelChildCine.Visibility == Visibility.Collapsed)
+            {
+                PanelChildCine.Visibility = Visibility.Visible;
+            }
+            else
+            {
+                PanelChildCine.Visibility = Visibility.Collapsed;
+            }
+        }
+        //ChildCore
+        private void ButtonChildChore_Click(object sender, RoutedEventArgs e)
+        {
+            if (PanelChildChore.Visibility == Visibility.Collapsed)
+            {
+                PanelChildChore.Visibility = Visibility.Visible;
+            }
+            else
+            {
+                PanelChildChore.Visibility = Visibility.Collapsed;
+            }
+        }
+
+        private void ButtonChildChore_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
+        {
+            if (PanelChildChore.Visibility == Visibility.Collapsed)
+            {
+                PanelChildChore.Visibility = Visibility.Visible;
+            }
+            else
+            {
+                PanelChildChore.Visibility = Visibility.Collapsed;
+            }
+        }
+        //Child1MouvCam
+        private void ButtonChild1MouvCam_Click(object sender, RoutedEventArgs e)
+        {
+            if (PanelChild1MouvCam.Visibility == Visibility.Collapsed)
+            {
+                PanelChild1MouvCam.Visibility = Visibility.Visible;
+            }
+            else
+            {
+                PanelChild1MouvCam.Visibility = Visibility.Collapsed;
+            }
+        }
+
+        private void ButtonChild1MouvCam_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
+        {
+            if (PanelChild1MouvCam.Visibility == Visibility.Collapsed)
+            {
+                PanelChild1MouvCam.Visibility = Visibility.Visible;
+            }
+            else
+            {
+                PanelChild1MouvCam.Visibility = Visibility.Collapsed;
+            }
+        }
+        //Child1AxeCam
+        private void buttonChild1AxeCam_Click(object sender, RoutedEventArgs e)
+        {
+            if (PanelChild1AxeCam.Visibility == Visibility.Collapsed)
+            {
+                PanelChild1AxeCam.Visibility = Visibility.Visible;
+            }
+            else
+            {
+                PanelChild1AxeCam.Visibility = Visibility.Collapsed;
+            }
+        }
+
+        private void buttonChild1AxeCam_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
+        {
+            if (PanelChild1AxeCam.Visibility == Visibility.Collapsed)
+            {
+                PanelChild1AxeCam.Visibility = Visibility.Visible;
+            }
+            else
+            {
+                PanelChild1AxeCam.Visibility = Visibility.Collapsed;
+            }
+        }
+        #endregion
+
+    
+    }
 }
\ No newline at end of file
--- a/src/FingersDance.Control.Player/App.xaml	Wed Jul 29 00:55:57 2009 +0200
+++ b/src/FingersDance.Control.Player/App.xaml	Fri Jul 31 00:45:42 2009 +0200
@@ -1,7 +1,7 @@
 <Application x:Class="FingersDance.Control.Player.App"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-    StartupUri="SurfaceWindow1.xaml"
+    StartupUri="SurfacePlayerTest.xaml"
     >
     <Application.Resources>
       <ResourceDictionary>
--- a/src/FingersDance.Control.Player/FingersDance.Control.Player.csproj	Wed Jul 29 00:55:57 2009 +0200
+++ b/src/FingersDance.Control.Player/FingersDance.Control.Player.csproj	Fri Jul 31 00:45:42 2009 +0200
@@ -56,6 +56,16 @@
     <Reference Include="Microsoft.Surface" />
     <Reference Include="Microsoft.Surface.Presentation" />
     <Reference Include="Microsoft.Surface.Presentation.Generic" />
+    <Page Include="UserControlPlayer.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Compile Include="UserControlPlayer.xaml.cs">
+      <DependentUpon>UserControlPlayer.xaml</DependentUpon>
+    </Compile>
+    <Content Include="Lake.wmv">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
   </ItemGroup>
   <ItemGroup>
     <ApplicationDefinition Include="App.xaml">
@@ -88,25 +98,27 @@
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
       <DependentUpon>Settings.settings</DependentUpon>
     </Compile>
-    <Compile Include="SurfaceWindow1.xaml.cs">
-      <DependentUpon>SurfaceWindow1.xaml</DependentUpon>
+    <Compile Include="SurfacePlayerTest.xaml.cs">
+      <DependentUpon>SurfacePlayerTest.xaml</DependentUpon>
     </Compile>
     <AppDesigner Include="Properties\" />
   </ItemGroup>
   <ItemGroup>
+    <Content Include="Resources\Butterfly.wmv" />
     <Content Include="Resources\icon.png">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     <Content Include="Resources\iconPreview.png">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
+    <Content Include="Resources\Lake.wmv" />
     <Resource Include="FingersDance.Control.Player.xml" />
   </ItemGroup>
   <ItemGroup>
     <Resource Include="Resources\WindowBackground.jpg" />
   </ItemGroup>
   <ItemGroup>
-    <Page Include="SurfaceWindow1.xaml">
+    <Page Include="SurfacePlayerTest.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
Binary file src/FingersDance.Control.Player/Lake.wmv has changed
--- a/src/FingersDance.Control.Player/Properties/Resources.Designer.cs	Wed Jul 29 00:55:57 2009 +0200
+++ b/src/FingersDance.Control.Player/Properties/Resources.Designer.cs	Fri Jul 31 00:45:42 2009 +0200
@@ -8,11 +8,10 @@
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace FingersDance.Control.Player.Properties
-{
+namespace FingersDance.Control.Player.Properties {
     using System;
-
-
+    
+    
     /// <summary>
     ///   A strongly-typed resource class, for looking up localized strings, etc.
     /// </summary>
@@ -23,48 +22,40 @@
     [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resources
-    {
-
+    internal class Resources {
+        
         private static global::System.Resources.ResourceManager resourceMan;
-
+        
         private static global::System.Globalization.CultureInfo resourceCulture;
-
+        
         [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal Resources()
-        {
+        internal Resources() {
         }
-
+        
         /// <summary>
         ///   Returns the cached ResourceManager instance used by this class.
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager
-        {
-            get
-            {
-                if (object.ReferenceEquals(resourceMan, null))
-                {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WPFAppTemplate.Properties.Resources", typeof(Resources).Assembly);
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FingersDance.Control.Player.Properties.Resources", typeof(Resources).Assembly);
                     resourceMan = temp;
                 }
                 return resourceMan;
             }
         }
-
+        
         /// <summary>
         ///   Overrides the current thread's CurrentUICulture property for all
         ///   resource lookups using this strongly typed resource class.
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture
-        {
-            get
-            {
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
                 return resourceCulture;
             }
-            set
-            {
+            set {
                 resourceCulture = value;
             }
         }
--- a/src/FingersDance.Control.Player/Properties/Resources.resx	Wed Jul 29 00:55:57 2009 +0200
+++ b/src/FingersDance.Control.Player/Properties/Resources.resx	Fri Jul 31 00:45:42 2009 +0200
@@ -46,7 +46,7 @@
     
     mimetype: application/x-microsoft.net.object.binary.base64
     value   : The object must be serialized with 
-            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
             : and then encoded with base64 encoding.
     
     mimetype: application/x-microsoft.net.object.soap.base64
@@ -60,6 +60,7 @@
             : and then encoded with base64 encoding.
     -->
   <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
     <xsd:element name="root" msdata:IsDataSet="true">
       <xsd:complexType>
         <xsd:choice maxOccurs="unbounded">
@@ -68,9 +69,10 @@
               <xsd:sequence>
                 <xsd:element name="value" type="xsd:string" minOccurs="0" />
               </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="name" use="required" type="xsd:string" />
               <xsd:attribute name="type" type="xsd:string" />
               <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
             </xsd:complexType>
           </xsd:element>
           <xsd:element name="assembly">
@@ -85,9 +87,10 @@
                 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                 <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
               </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
               <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
               <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
             </xsd:complexType>
           </xsd:element>
           <xsd:element name="resheader">
@@ -109,9 +112,9 @@
     <value>2.0</value>
   </resheader>
   <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
 </root>
\ No newline at end of file
Binary file src/FingersDance.Control.Player/Resources/Butterfly.wmv has changed
Binary file src/FingersDance.Control.Player/Resources/Lake.wmv has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/FingersDance.Control.Player/SurfacePlayerTest.xaml	Fri Jul 31 00:45:42 2009 +0200
@@ -0,0 +1,27 @@
+<s:SurfaceWindow
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:s="http://schemas.microsoft.com/surface/2008"
+    x:Class="FingersDance.Control.Player.SurfaceWindow1"
+    Title="FingersDance.Control.Player"
+    x:Name="SurfacePlayerTest" xmlns:FingersDance_Control_Player="clr-namespace:FingersDance.Control.Player" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
+    >
+  <s:SurfaceWindow.Resources>
+    <ImageBrush x:Key="WindowBackground" Stretch="None" Opacity="0.6" ImageSource="pack://application:,,,/Resources/WindowBackground.jpg"/>
+  </s:SurfaceWindow.Resources>
+
+  <Grid Background="{StaticResource WindowBackground}" >
+  	<FingersDance_Control_Player:UserControlPlayer HorizontalAlignment="Right" Margin="0,237.999,36.26,22.054" Width="301.507" RenderTransformOrigin="0.5,0.5">
+  		<FingersDance_Control_Player:UserControlPlayer.RenderTransform>
+  			<TransformGroup>
+  				<ScaleTransform ScaleX="1" ScaleY="1"/>
+  				<SkewTransform AngleX="0" AngleY="0"/>
+  				<RotateTransform Angle="0.388"/>
+  				<TranslateTransform X="0" Y="0"/>
+  			</TransformGroup>
+  		</FingersDance_Control_Player:UserControlPlayer.RenderTransform>
+  	</FingersDance_Control_Player:UserControlPlayer>
+  	<FingersDance_Control_Player:UserControlPlayer Margin="75,22,0,238.904" d:LayoutOverrides="VerticalAlignment" Width="263" HorizontalAlignment="Left"/>
+
+  </Grid>
+</s:SurfaceWindow>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/FingersDance.Control.Player/SurfacePlayerTest.xaml.cs	Fri Jul 31 00:45:42 2009 +0200
@@ -0,0 +1,103 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+using System.Windows.Threading;
+using Microsoft.Surface;
+using Microsoft.Surface.Presentation;
+using Microsoft.Surface.Presentation.Controls;
+
+namespace FingersDance.Control.Player
+{
+    /// <summary>
+    /// Interaction logic for SurfaceWindow1.xaml
+    /// </summary>
+    public partial class SurfaceWindow1 : SurfaceWindow
+    {
+        /// <summary>
+        /// Default constructor.
+        /// </summary>
+        public SurfaceWindow1()
+        {
+            InitializeComponent();
+
+            // Add handlers for Application activation events
+            AddActivationHandlers();
+        }
+
+
+        /// <summary>
+        /// Occurs when the window is about to close. 
+        /// </summary>
+        /// <param name="e"></param>
+        protected override void OnClosed(EventArgs e)
+        {
+            base.OnClosed(e);
+
+            // Remove handlers for Application activation events
+            RemoveActivationHandlers();
+        }
+
+        /// <summary>
+        /// Adds handlers for Application activation events.
+        /// </summary>
+        private void AddActivationHandlers()
+        {
+            // Subscribe to surface application activation events
+            ApplicationLauncher.ApplicationActivated += OnApplicationActivated;
+            ApplicationLauncher.ApplicationPreviewed += OnApplicationPreviewed;
+            ApplicationLauncher.ApplicationDeactivated += OnApplicationDeactivated;
+        }
+
+        /// <summary>
+        /// Removes handlers for Application activation events.
+        /// </summary>
+        private void RemoveActivationHandlers()
+        {
+            // Unsubscribe from surface application activation events
+            ApplicationLauncher.ApplicationActivated -= OnApplicationActivated;
+            ApplicationLauncher.ApplicationPreviewed -= OnApplicationPreviewed;
+            ApplicationLauncher.ApplicationDeactivated -= OnApplicationDeactivated;
+        }
+
+        /// <summary>
+        /// This is called when application has been activated.
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void OnApplicationActivated(object sender, EventArgs e)
+        {
+            //TODO: enable audio, animations here
+        }
+
+        /// <summary>
+        /// This is called when application is in preview mode.
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void OnApplicationPreviewed(object sender, EventArgs e)
+        {
+            //TODO: Disable audio here if it is enabled
+
+            //TODO: optionally enable animations here
+        }
+
+        /// <summary>
+        ///  This is called when application has been deactivated.
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void OnApplicationDeactivated(object sender, EventArgs e)
+        {
+            //TODO: disable audio, animations here
+        }
+    }
+}
\ No newline at end of file
--- a/src/FingersDance.Control.Player/SurfaceWindow1.xaml	Wed Jul 29 00:55:57 2009 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<s:SurfaceWindow x:Class="FingersDance.Control.Player.SurfaceWindow1"
-    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-    xmlns:s="http://schemas.microsoft.com/surface/2008"
-    Title="FingersDance.Control.Player"
-    >
-  <s:SurfaceWindow.Resources>
-    <ImageBrush x:Key="WindowBackground" Stretch="None" Opacity="0.6" ImageSource="pack://application:,,,/Resources/WindowBackground.jpg"/>
-  </s:SurfaceWindow.Resources>
-
-  <Grid Background="{StaticResource WindowBackground}" >
-
-  </Grid>
-</s:SurfaceWindow>
--- a/src/FingersDance.Control.Player/SurfaceWindow1.xaml.cs	Wed Jul 29 00:55:57 2009 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-using System.Windows.Threading;
-using Microsoft.Surface;
-using Microsoft.Surface.Presentation;
-using Microsoft.Surface.Presentation.Controls;
-
-namespace FingersDance.Control.Player
-{
-    /// <summary>
-    /// Interaction logic for SurfaceWindow1.xaml
-    /// </summary>
-    public partial class SurfaceWindow1 : SurfaceWindow
-    {
-        /// <summary>
-        /// Default constructor.
-        /// </summary>
-        public SurfaceWindow1()
-        {
-            InitializeComponent();
-
-            // Add handlers for Application activation events
-            AddActivationHandlers();
-        }
-
-
-        /// <summary>
-        /// Occurs when the window is about to close. 
-        /// </summary>
-        /// <param name="e"></param>
-        protected override void OnClosed(EventArgs e)
-        {
-            base.OnClosed(e);
-
-            // Remove handlers for Application activation events
-            RemoveActivationHandlers();
-        }
-
-        /// <summary>
-        /// Adds handlers for Application activation events.
-        /// </summary>
-        private void AddActivationHandlers()
-        {
-            // Subscribe to surface application activation events
-            ApplicationLauncher.ApplicationActivated += OnApplicationActivated;
-            ApplicationLauncher.ApplicationPreviewed += OnApplicationPreviewed;
-            ApplicationLauncher.ApplicationDeactivated += OnApplicationDeactivated;
-        }
-
-        /// <summary>
-        /// Removes handlers for Application activation events.
-        /// </summary>
-        private void RemoveActivationHandlers()
-        {
-            // Unsubscribe from surface application activation events
-            ApplicationLauncher.ApplicationActivated -= OnApplicationActivated;
-            ApplicationLauncher.ApplicationPreviewed -= OnApplicationPreviewed;
-            ApplicationLauncher.ApplicationDeactivated -= OnApplicationDeactivated;
-        }
-
-        /// <summary>
-        /// This is called when application has been activated.
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void OnApplicationActivated(object sender, EventArgs e)
-        {
-            //TODO: enable audio, animations here
-        }
-
-        /// <summary>
-        /// This is called when application is in preview mode.
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void OnApplicationPreviewed(object sender, EventArgs e)
-        {
-            //TODO: Disable audio here if it is enabled
-
-            //TODO: optionally enable animations here
-        }
-
-        /// <summary>
-        ///  This is called when application has been deactivated.
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void OnApplicationDeactivated(object sender, EventArgs e)
-        {
-            //TODO: disable audio, animations here
-        }
-    }
-}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/FingersDance.Control.Player/UserControlPlayer.xaml	Fri Jul 31 00:45:42 2009 +0200
@@ -0,0 +1,25 @@
+<UserControl
+	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	mc:Ignorable="d"
+	x:Class="FingersDance.Control.Player.UserControlPlayer"
+	x:Name="UserControl"
+	Width="Auto" Height="Auto" xmlns:Custom="http://schemas.microsoft.com/surface/2008">
+
+	<StackPanel x:Name="LayoutRoot" Width="Auto" Height="Auto" Background="{x:Null}">
+		<Grid Width="Auto" Height="200" MaxWidth="500">
+			<Grid.Background>
+				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
+					<GradientStop Color="#FFFFF9F9" Offset="0"/>
+					<GradientStop Color="#FFFFFFFF" Offset="1"/>
+					<GradientStop Color="#FF464646" Offset="0.08"/>
+					<GradientStop Color="#FF262626" Offset="0.902"/>
+				</LinearGradientBrush>
+			</Grid.Background>
+			<MediaElement x:Name="MediaElementVideo" Width="Auto" Height="Auto" Source="Lake.wmv"/>
+		</Grid>
+		<Custom:SurfaceButton FontSize="12" FontWeight="Bold" x:Name="ButtonPlayPause" Content="Play/Pause" Width="Auto" Height="36.096" ContactDown="ButtonPlayPause_ContactDown" Click="ButtonPlayPause_Click"/>
+	</StackPanel>
+</UserControl>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/FingersDance.Control.Player/UserControlPlayer.xaml.cs	Fri Jul 31 00:45:42 2009 +0200
@@ -0,0 +1,80 @@
+using System;
+using System.IO;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Animation;
+using System.Windows.Navigation;
+using System.ComponentModel;
+
+namespace FingersDance.Control.Player
+{
+	public partial class UserControlPlayer
+	{
+
+        private bool play;
+
+		public UserControlPlayer()
+		{
+			this.InitializeComponent();
+             
+            initPlayer();
+		}
+
+        void initPlayer()
+        { 
+            //init player
+            play = false;
+            //MediaElementVideo.Source = new Uri("Resources\\Lake.wmv", UriKind.Relative);
+            MediaElementVideo.LoadedBehavior = MediaState.Manual;
+        }
+
+        private void ButtonPlayPause_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
+        {
+            if (!play)//Play
+            {
+                play = true;
+                try
+                {
+                    MediaElementVideo.Play();
+                }
+                catch (Exception ex) { }
+            }
+            else//Pause
+            {
+                play = false;
+                try
+                {
+                    MediaElementVideo.Pause();
+                }
+                catch (Exception exx ) { }
+            }
+
+        }
+
+        private void ButtonPlayPause_Click(object sender, RoutedEventArgs e)
+        {
+            if (!play)//Play
+            {
+                play = true;
+                try
+                {
+                    MediaElementVideo.Play();
+                }
+                catch (Exception ex ) { }
+            }
+            else//Pause
+            {
+                play = false;
+                try
+                {
+                    MediaElementVideo.Pause();
+                }
+                catch (Exception exx ) { }
+            }
+        }
+	}
+}
\ No newline at end of file