src/FingersDance.Control.Player/UserControlPlayer.xaml.cs
changeset 134 f5108a598aa7
parent 122 b489c2756a13
child 135 84b3bf5ee3d2
--- a/src/FingersDance.Control.Player/UserControlPlayer.xaml.cs	Mon Oct 05 19:27:24 2009 +0200
+++ b/src/FingersDance.Control.Player/UserControlPlayer.xaml.cs	Tue Oct 06 14:02:09 2009 +0200
@@ -11,6 +11,10 @@
 using System.ComponentModel;
 using System.Reflection;
 
+using Microsoft.Surface.Presentation;
+using FingersDance.Views;
+using FingersDance.ViewModels;
+
 namespace FingersDance.Control.Player
 {
 	public partial class UserControlPlayer
@@ -171,5 +175,32 @@
             if(PlayerOpened!=null)
                 PlayerOpened(this, new EventArgs());
         }
+
+        private void Play_Pause_area_DragEnter(object sender, SurfaceDragDropEventArgs e)
+        {
+            //Console.WriteLine("Enter");
+            //Play_Pause_area.Opacity = 0.5;
+        }
+
+        private void Play_Pause_area_DragLeave(object sender, SurfaceDragDropEventArgs e)
+        {
+            //Console.WriteLine("Leave");
+            //Play_Pause_area.Opacity = 0;
+        }
+
+        private void Play_Pause_area_DragOver(object sender, SurfaceDragDropEventArgs e)
+        {
+            //Console.WriteLine("Over");
+        }
+
+        private void Play_Pause_area_Drop(object sender, SurfaceDragDropEventArgs e)
+        {
+            //Console.WriteLine("Drop");
+            // e.Cursor.Visual is the ContentControl, so its Content is the dragged TimelineAnnotationView
+            AnnotationViewModel annotationDataVM = (AnnotationViewModel)((TimelineAnnotationView)((ContentControl)e.Cursor.Visual).Content).DataContext;
+            int nbSeconds = (int)annotationDataVM.TcBegin;
+            int nbMilliSec = (int)((annotationDataVM.TcBegin * 1000)%1000);
+            MediaElementVideo.Position = new TimeSpan(0, 0, 0, nbSeconds, nbMilliSec);
+        }
 	}
 }
\ No newline at end of file