Travail sur le Pivot et le control Session Input
authorsarias
Sun, 20 Sep 2009 18:02:37 +0200
changeset 77 e95e916eb018
parent 76 5af0f0a8706d
child 78 3bf9b343158d
child 79 b13d98b59241
Travail sur le Pivot et le control Session Input
src/FingersDance.Control.ListVideo/UserControlListVideo.xaml
src/FingersDance.Control.ListVideo/UserControlListVideo.xaml.cs
src/FingersDance.Control.Pivot/UserControlPivot.xaml
src/FingersDance.Control.Pivot/UserControlPivot.xaml.cs
src/FingersDance.Control.Player/UserControlPlayer.xaml.cs
src/FingersDance.Control.SessionInput/UserControlSessionInput.xaml
src/FingersDance/FingersDance.csproj
src/FingersDance/MainSurfaceWindow.xaml
src/FingersDance/MainSurfaceWindow.xaml.cs
--- a/src/FingersDance.Control.ListVideo/UserControlListVideo.xaml	Thu Sep 17 18:44:33 2009 +0200
+++ b/src/FingersDance.Control.ListVideo/UserControlListVideo.xaml	Sun Sep 20 18:02:37 2009 +0200
@@ -11,10 +11,10 @@
 	<Grid x:Name="LayoutRoot" Width="{Binding Path=ActualWidth, ElementName=UserControl, Mode=Default}" Height="{Binding Path=ActualHeight, ElementName=UserControl, Mode=Default}">
 		<Custom:SurfaceListBox IsSynchronizedWithCurrentItem="True" Background="{x:Null}" ScrollViewer.VerticalScrollBarVisibility="Hidden" Width="{Binding Path=ActualWidth, ElementName=UserControl, Mode=Default}" Height="{Binding Path=ActualHeight, ElementName=UserControl, Mode=Default}" x:Name="ListBoxVideos">
 			<StackPanel Width="404" Height="272.56" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" x:Name="StackPanel">
-				<Custom:SurfaceListBoxItem Width="200" Height="200" Background="#00FFFFFF" x:Name="ItemVideo1" ContactDown="ItemVideo1_ContactDown" Selected="ItemVideo1_Selected" ContactTapGesture="ItemVideo1_ContactTapGesture">
+				<Custom:SurfaceListBoxItem Width="200" Height="200" Background="#00FFFFFF" x:Name="ItemVideo1" ContactTapGesture="ItemVideo1_ContactTapGesture">
 					<Image Width="200" Height="200" Source="Butterfly.jpg"/>
 				</Custom:SurfaceListBoxItem>
-				<Custom:SurfaceListBoxItem Width="200" Height="200" x:Name="ItemVideo2" ContactDown="ItemVideo2_ContactDown">
+				<Custom:SurfaceListBoxItem Width="200" Height="200" x:Name="ItemVideo2">
 					<Image Width="200" Height="200" Source="Lake.jpg"/>
 				</Custom:SurfaceListBoxItem>
 			</StackPanel>
--- a/src/FingersDance.Control.ListVideo/UserControlListVideo.xaml.cs	Thu Sep 17 18:44:33 2009 +0200
+++ b/src/FingersDance.Control.ListVideo/UserControlListVideo.xaml.cs	Sun Sep 20 18:02:37 2009 +0200
@@ -12,7 +12,7 @@
 {
 	public partial class UserControlListVideo
 	{
-
+        //Creation d'un Event pour Chaque Item Video
         public event EventHandler EH_ItemVideo1_ContactDown;
         public event EventHandler EH_ItemVideo2_ContactDown;
 
@@ -35,11 +35,7 @@
                 EH_ItemVideo2_ContactDown(this, new EventArgs());
         }
 
-        private void ItemVideo1_Selected(object sender, RoutedEventArgs e)
-        {
-
-        }
-
+        //Event appelé lors de la selection d'un Item dans la Video List
         private void ItemVideo1_ContactTapGesture(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
         {
             if (EH_ItemVideo1_ContactDown != null)
--- a/src/FingersDance.Control.Pivot/UserControlPivot.xaml	Thu Sep 17 18:44:33 2009 +0200
+++ b/src/FingersDance.Control.Pivot/UserControlPivot.xaml	Sun Sep 20 18:02:37 2009 +0200
@@ -5,7 +5,7 @@
 	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 	mc:Ignorable="d"
 	x:Class="FingersDance.Control.Pivot.UserControlPivot"
-	x:Name="UserControl" Width="70" Height="70" xmlns:Custom="http://schemas.microsoft.com/surface/2008">
+	x:Name="UserControl" Width="90" Height="90" xmlns:Custom="http://schemas.microsoft.com/surface/2008">
 	<UserControl.Resources>
 		<ResourceDictionary>
 			<ResourceDictionary.MergedDictionaries>
@@ -22,24 +22,9 @@
 			<ColumnDefinition Width="0.506*"/>
 			<ColumnDefinition Width="0.494*"/>
 		</Grid.ColumnDefinitions>
-		<Ellipse Stroke="#FFFFFFFF" Grid.ColumnSpan="2" Grid.RowSpan="2" StrokeThickness="1.5">
-			<Ellipse.Fill>
-				<RadialGradientBrush>
-					<RadialGradientBrush.RelativeTransform>
-						<TransformGroup>
-							<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="0.93" ScaleY="0.93"/>
-							<SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5"/>
-							<RotateTransform Angle="0" CenterX="0.5" CenterY="0.5"/>
-							<TranslateTransform X="0" Y="0"/>
-						</TransformGroup>
-					</RadialGradientBrush.RelativeTransform>
-					<GradientStop Color="#FFFFFFFF" Offset="0"/>
-					<GradientStop Color="#FF000000" Offset="0.258"/>
-				</RadialGradientBrush>
-			</Ellipse.Fill>
-		</Ellipse>
-		<Custom:SurfaceButton BorderThickness="0,0,0,0" HorizontalAlignment="Center" x:Name="SurfaceButtonPlayer1" VerticalAlignment="Center" Content="" Background="{DynamicResource Color_8_#230FD2_xaml}" ContactDown="SurfaceButtonPlayer1_ContactDown" Click="SurfaceButtonPlayer1_Click"/>
-		<Custom:SurfaceButton Content="" HorizontalAlignment="Center" x:Name="SurfaceButtonPlayer2" VerticalAlignment="Center" Grid.Column="1" RenderTransformOrigin="0.5,0.5" Background="{DynamicResource Color_4_#FF0000_xaml}" ContactDown="SurfaceButtonPlayer2_ContactDown" Click="SurfaceButtonPlayer2_Click">
+		<Ellipse Stroke="#FFFFFFFF" Grid.ColumnSpan="2" Grid.RowSpan="2" StrokeThickness="0.5" Fill="#FF000000" Margin="0.462,0,-0.462,0"/>
+		<Custom:SurfaceButton BorderThickness="0,0,0,0" x:Name="SurfaceButtonPlayer1" Content="" Background="{DynamicResource Color_8_#230FD2_xaml}" ContactDown="SurfaceButtonPlayer1_ContactDown" Click="SurfaceButtonPlayer1_Click" Margin="10.377,11.057,6.827,5.11"/>
+		<Custom:SurfaceButton Content="" x:Name="SurfaceButtonPlayer2" Grid.Column="1" RenderTransformOrigin="0.5,0.5" Background="{DynamicResource Color_4_#FF0000_xaml}" ContactDown="SurfaceButtonPlayer2_ContactDown" Click="SurfaceButtonPlayer2_Click" Margin="6.335,11.235,9.272,4.932">
 			<Custom:SurfaceButton.RenderTransform>
 				<TransformGroup>
 					<ScaleTransform ScaleX="-1" ScaleY="1"/>
@@ -49,7 +34,7 @@
 				</TransformGroup>
 			</Custom:SurfaceButton.RenderTransform>
 		</Custom:SurfaceButton>
-		<Custom:SurfaceButton Content="" HorizontalAlignment="Center" x:Name="SurfaceButtonPlayer3" VerticalAlignment="Center" Grid.Row="1" RenderTransformOrigin="0.5,0.5" Background="{DynamicResource Color_12_#00C800_xaml}" ContactDown="SurfaceButtonPlayer3_ContactDown" Click="SurfaceButtonPlayer3_Click" >
+		<Custom:SurfaceButton Content="" x:Name="SurfaceButtonPlayer3" Grid.Row="1" RenderTransformOrigin="0.5,0.5" Background="{DynamicResource Color_12_#00C800_xaml}" ContactDown="SurfaceButtonPlayer3_ContactDown" Click="SurfaceButtonPlayer3_Click" Margin="10.04,4.107,6.527,11.888" >
 			<Custom:SurfaceButton.RenderTransform>
 				<TransformGroup>
 					<ScaleTransform ScaleX="1" ScaleY="-1"/>
@@ -59,7 +44,7 @@
 				</TransformGroup>
 			</Custom:SurfaceButton.RenderTransform>
 		</Custom:SurfaceButton>
-		<Custom:SurfaceButton Content=""  Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="SurfaceButtonPlayer4" RenderTransformOrigin="0.5,0.5" Background="{DynamicResource Color_2_#FFC800_xaml}" ContactDown="SurfaceButtonPlayer4_ContactDown" Click="SurfaceButtonPlayer4_Click">
+		<Custom:SurfaceButton Content=""  Grid.Row="1" Grid.Column="1" x:Name="SurfaceButtonPlayer4" RenderTransformOrigin="0.5,0.5" Background="{DynamicResource Color_2_#FFC800_xaml}" ContactDown="SurfaceButtonPlayer4_ContactDown" Click="SurfaceButtonPlayer4_Click" Margin="6.365,3.685,7.938,12.539">
 			<Custom:SurfaceButton.RenderTransform>
 				<TransformGroup>
 					<ScaleTransform ScaleX="-1" ScaleY="-1"/>
@@ -69,7 +54,13 @@
 				</TransformGroup>
 			</Custom:SurfaceButton.RenderTransform>
 		</Custom:SurfaceButton>
-		<Ellipse Height="17.573" HorizontalAlignment="Right" VerticalAlignment="Top" Width="17.573" Margin="0,-8.742,-8.566,0" Grid.Row="1" Fill="{x:Null}" StrokeThickness="1.5">
+		<Ellipse Height="25" HorizontalAlignment="Left" VerticalAlignment="Top" Width="25" Margin="-12.479,-12.358,0,0" Grid.Row="1" StrokeThickness="0.5" Grid.Column="1">
+			<Ellipse.Fill>
+				<RadialGradientBrush>
+					<GradientStop Color="#FF000000" Offset="0.788"/>
+					<GradientStop Color="#FFFFFFFF" Offset="0"/>
+				</RadialGradientBrush>
+			</Ellipse.Fill>
 			<Ellipse.Stroke>
 				<RadialGradientBrush>
 					<GradientStop Color="#FF8A8888" Offset="0"/>
--- a/src/FingersDance.Control.Pivot/UserControlPivot.xaml.cs	Thu Sep 17 18:44:33 2009 +0200
+++ b/src/FingersDance.Control.Pivot/UserControlPivot.xaml.cs	Sun Sep 20 18:02:37 2009 +0200
@@ -12,6 +12,7 @@
 {
 	public partial class UserControlPivot
 	{
+        //Events pour chaque Boutton du Pivot
         public event EventHandler EH_SurfaceButtonPlayer1_ContactDown;
         public event EventHandler EH_SurfaceButtonPlayer2_ContactDown;
         public event EventHandler EH_SurfaceButtonPlayer3_ContactDown;
--- a/src/FingersDance.Control.Player/UserControlPlayer.xaml.cs	Thu Sep 17 18:44:33 2009 +0200
+++ b/src/FingersDance.Control.Player/UserControlPlayer.xaml.cs	Sun Sep 20 18:02:37 2009 +0200
@@ -59,7 +59,7 @@
             //DirectoryInfo info = Directory.GetParent(@".");
             FileInfo assemblyPath = new FileInfo(Assembly.GetExecutingAssembly().Location);
             DirectoryInfo info = assemblyPath.Directory;
-            MediaElementVideo.Source = new Uri(@"" + info.FullName.ToString() + "\\Resources\\oneflat.wmv", UriKind.Relative);
+            MediaElementVideo.Source = new Uri(@"" + info.FullName.ToString() + "\\Resources\\Lake.wmv", UriKind.Relative);
             MediaElementVideo.LoadedBehavior = MediaState.Manual;
             MediaElementVideo.UnloadedBehavior = MediaState.Manual;
             MediaElementVideo.ScrubbingEnabled= true;
--- a/src/FingersDance.Control.SessionInput/UserControlSessionInput.xaml	Thu Sep 17 18:44:33 2009 +0200
+++ b/src/FingersDance.Control.SessionInput/UserControlSessionInput.xaml	Sun Sep 20 18:02:37 2009 +0200
@@ -10,11 +10,16 @@
 
 	<Grid x:Name="LayoutRoot">
 		<Custom:SurfaceTextBox d:LayoutOverrides="HorizontalAlignment" Margin="112,12.818,8,0" x:Name="ST_Name" VerticalAlignment="Top" Text="" TextWrapping="Wrap"/>
-		<Custom:SurfaceTextBox d:LayoutOverrides="HorizontalAlignment, VerticalAlignment" Margin="112,40.978,8,0" x:Name="ST_Date" VerticalAlignment="Top" Text="" TextWrapping="Wrap"/>
-		<Custom:SurfaceTextBox d:LayoutOverrides="HorizontalAlignment, VerticalAlignment, Height" Margin="112,70.586,8,0" x:Name="ST_Alias" VerticalAlignment="Top" Text="" TextWrapping="Wrap"/>
-		<Custom:SurfaceTextBox d:LayoutOverrides="HorizontalAlignment, VerticalAlignment" Margin="112,92.546,8,0" x:Name="ST_Email" VerticalAlignment="Top" Text="" TextWrapping="Wrap"/>
-		<Custom:SurfaceTextBox d:LayoutOverrides="HorizontalAlignment, Height" Margin="112,0,8,59.534" x:Name="ST_Desc" VerticalAlignment="Bottom" Text="" TextWrapping="Wrap"/>
-		<Custom:SurfaceButton RenderTransformOrigin="0.5,0.5" Margin="82.321,0,123.679,5.534" VerticalAlignment="Bottom" Content="" Height="50" x:Name="SurfaceButtonSubmit" ContactDown="SurfaceButtonSubmit_ContactDown" Click="SurfaceButtonSubmit_Click">
+		<Label HorizontalAlignment="Left" VerticalAlignment="Top" Content="Name:" Margin="14.367,4.818,0,0" x:Name="LName"/>
+		<Custom:SurfaceTextBox d:LayoutOverrides="HorizontalAlignment, VerticalAlignment" Margin="112,36.626,8,0" x:Name="ST_Date" VerticalAlignment="Top" Text="" TextWrapping="Wrap"/>
+		<Label HorizontalAlignment="Left" VerticalAlignment="Top" Content="Date:" Margin="14.367,28.626,0,0" x:Name="LDate"/>
+		<Custom:SurfaceTextBox d:LayoutOverrides="HorizontalAlignment, VerticalAlignment, Height" Margin="112,62.586,8,0" x:Name="ST_Alias" VerticalAlignment="Top" Text="" TextWrapping="Wrap"/>
+		<Label HorizontalAlignment="Left" VerticalAlignment="Top" Content="Alias:" Margin="14.367,54.586,0,0" x:Name="LAlias"/>
+		<Custom:SurfaceTextBox d:LayoutOverrides="HorizontalAlignment, VerticalAlignment" Margin="112,87.677,8,0" x:Name="ST_Email" VerticalAlignment="Top" Text="" TextWrapping="Wrap"/>
+		<Label HorizontalAlignment="Left" Content="Email:" d:LayoutOverrides="Height" Margin="14.367,80.546,0,85.494" x:Name="LEmail"/>
+		<Custom:SurfaceTextBox d:LayoutOverrides="HorizontalAlignment, Height" Margin="112,0,8,64.403" x:Name="ST_Desc" VerticalAlignment="Bottom" Text="" TextWrapping="Wrap"/>
+		<Label HorizontalAlignment="Left" VerticalAlignment="Bottom" Content="Description:" Margin="14.367,0,0,64.403" Width="74.321" d:LayoutOverrides="Height"/>
+		<Custom:SurfaceButton RenderTransformOrigin="0.5,0.5" Margin="112,0,94,8" VerticalAlignment="Bottom" Content="" Height="50" x:Name="SurfaceButtonSubmit" ContactDown="SurfaceButtonSubmit_ContactDown" Click="SurfaceButtonSubmit_Click">
 			<Custom:SurfaceButton.RenderTransform>
 				<TransformGroup>
 					<ScaleTransform ScaleX="1" ScaleY="1"/>
--- a/src/FingersDance/FingersDance.csproj	Thu Sep 17 18:44:33 2009 +0200
+++ b/src/FingersDance/FingersDance.csproj	Sun Sep 20 18:02:37 2009 +0200
@@ -129,7 +129,6 @@
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
     <Content Include="Resources\oneflat.wmv">
-      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
     <Resource Include="FingersDance.xml" />
   </ItemGroup>
--- a/src/FingersDance/MainSurfaceWindow.xaml	Thu Sep 17 18:44:33 2009 +0200
+++ b/src/FingersDance/MainSurfaceWindow.xaml	Sun Sep 20 18:02:37 2009 +0200
@@ -68,8 +68,8 @@
   		
   		<Rectangle Fill="{x:Null}" Stroke="#FFFFFFFF"/>
   	</Grid>
-  	<s:ScatterView x:Name="ScaterView"  ContactChanged="ScaterView_ContactChanged">
-  		<s:ScatterViewItem   Center="512,384" CanMove="True" CanRotate="False" CanScale="False" Background="{x:Null}" x:Name="ScatterViewItemPivot" >
+  	<s:ScatterView x:Name="scaterview"  ContactChanged="scaterview_ContactChanged">
+  		<s:ScatterViewItem   Center="512,384" CanMove="True" CanRotate="False" CanScale="False" Background="{x:Null}" x:Name="ScatterViewItemPivot" ContactChanged="ScatterViewItemPivot_ContactChanged" >
   			<FingersDance_Control_Pivot:UserControlPivot x:Name="UserControlPivot" EH_SurfaceButtonPlayer1_ContactDown="UserControlPivot_EH_SurfaceButtonPlayer1_ContactDown" EH_SurfaceButtonPlayer2_ContactDown="UserControlPivot_EH_SurfaceButtonPlayer2_ContactDown" EH_SurfaceButtonPlayer3_ContactDown="UserControlPivot_EH_SurfaceButtonPlayer3_ContactDown" EH_SurfaceButtonPlayer4_ContactDown="UserControlPivot_EH_SurfaceButtonPlayer4_ContactDown"/>
   		</s:ScatterViewItem>
   	</s:ScatterView>
--- a/src/FingersDance/MainSurfaceWindow.xaml.cs	Thu Sep 17 18:44:33 2009 +0200
+++ b/src/FingersDance/MainSurfaceWindow.xaml.cs	Sun Sep 20 18:02:37 2009 +0200
@@ -55,7 +55,7 @@
         {
             try
             {
-                ScatterViewItem item = (ScatterViewItem)ScaterView.Items.GetItemAt(0);
+                ScatterViewItem item = (ScatterViewItem)scaterview.Items.GetItemAt(0);
                 item.DecelerationRate = double.NaN;
             }
             catch (Exception ex) { }
@@ -66,7 +66,7 @@
             //Initialise les 4 Grids à la positions initiale du Pivot.   
             try
             {
-                ScatterViewItem item = (ScatterViewItem)ScaterView.Items.GetItemAt(0);
+                ScatterViewItem item = (ScatterViewItem)scaterview.Items.GetItemAt(0);
                 Grid1.Width =item.Center.X;
                 Grid1.Height = item.Center.Y;
                 
@@ -149,7 +149,27 @@
             //TODO: disable audio, animations here
         }
 
-        private void ScaterView_ContactChanged(object sender, ContactEventArgs e)
+        private void scaterview_ContactChanged(object sender, ContactEventArgs e)
+        {
+            //Permet la MAJ des 4 Grids à la position du pivot
+            /*try
+            {
+                Grid1.Width = e.GetPosition(mainSurfaceWindow).X;
+                Grid1.Height = e.GetPosition(mainSurfaceWindow).Y;
+
+                Grid3.Width = e.GetPosition(mainSurfaceWindow).X;
+                Grid3.Height = 768 - e.GetPosition(mainSurfaceWindow).Y;
+
+                Grid4.Width = 1024 - e.GetPosition(mainSurfaceWindow).X;
+                Grid4.Height = 768 - e.GetPosition(mainSurfaceWindow).Y;
+
+                Grid2.Width = 1024 - e.GetPosition(mainSurfaceWindow).X;
+                Grid2.Height = e.GetPosition(mainSurfaceWindow).Y;
+            }
+            catch (Exception ex) { }*/
+        }
+
+        private void ScatterViewItemPivot_ContactChanged(object sender, ContactEventArgs e)
         {
             //Permet la MAJ des 4 Grids à la position du pivot
             try
@@ -176,7 +196,10 @@
             {
                 UserControlListVideo ListVideo1 = new UserControlListVideo();
                 ListVideo1.Name = "ListVideo1";
+                
                 Grid1.Children.Add(ListVideo1);
+
+                //Creation des Events pour chaque item de la video
                 ListVideo1.EH_ItemVideo1_ContactDown += new System.EventHandler(this.ListVideo1_EH_ItemVideo1_ContactDown);
                 ListVideo1.EH_ItemVideo2_ContactDown += new System.EventHandler(this.ListVideo1_EH_ItemVideo2_ContactDown);
                 /*
@@ -222,6 +245,12 @@
 
         private void ListVideo1_EH_ItemVideo1_ContactDown(object sender, EventArgs e)
         {
+
+            //Creation d'un ScatterView Item
+            //ScatterViewItem scatterViewItemSessionInput = new ScatterViewItem();
+            //scatterViewItemSessionInput.Name = "ScatterViewItemSessionInput";
+            
+            
             //Creation d'une nouvelle seance.
                 
             UserControlSessionInput SessionInput = new UserControlSessionInput();
@@ -233,6 +262,14 @@
 
                 SessionInput.EH_SurfaceButtonSubmit_ContactDown += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown);
                 actualGrid.Children.Remove((UserControlListVideo)sender);
+
+                //Init Scatter View Properties and Add it to the scatter view.
+                /*scatterViewItemSessionInput.Content = SessionInput;
+                scatterViewItemSessionInput.CanMove = true;
+                scatterViewItemSessionInput.CanScale = false;
+                scatterViewItemSessionInput.CanRotate = true;
+                scatterViewItemSessionInput.Center = new Point((double)actualGrid.ActualWidth,(double)actualGrid.ActualHeight);
+                scaterview.Items.Add(scatterViewItemSessionInput);*/
             }
             catch (Exception ex) { }
             isCreatedP1 = true;
@@ -259,5 +296,7 @@
             catch (Exception ex) { }
         }
 
+
+
     }
 }
\ No newline at end of file