# HG changeset patch
# User cavaliet
# Date 1254830529 -7200
# Node ID f5108a598aa75009b7df541a480480f86a854333
# Parent 8d755ba035f967b3fd0d0ab54fcfe44d97d4c3fc
drag and drop places the video at the good timecode.
diff -r 8d755ba035f9 -r f5108a598aa7 src/FingersDance.Control.Player/FingersDance.Control.Player.csproj
--- a/src/FingersDance.Control.Player/FingersDance.Control.Player.csproj Mon Oct 05 19:27:24 2009 +0200
+++ b/src/FingersDance.Control.Player/FingersDance.Control.Player.csproj Tue Oct 06 14:02:09 2009 +0200
@@ -146,6 +146,14 @@
{1E80D5A1-C45C-443B-8992-4A4D78D280FC}
FingersDance.Actions
+
+ {E81BB080-0598-43AC-90CE-54D6570C4E9E}
+ FingersDance.ViewModels
+
+
+ {0B308B6E-7B1E-46C0-ACC7-0B7EFC4D0B2C}
+ FingersDance.Views
+
\ No newline at end of file
diff -r 8d755ba035f9 -r f5108a598aa7 src/FingersDance.Control.Player/UserControlPlayer.xaml
--- a/src/FingersDance.Control.Player/UserControlPlayer.xaml Mon Oct 05 19:27:24 2009 +0200
+++ b/src/FingersDance.Control.Player/UserControlPlayer.xaml Tue Oct 06 14:02:09 2009 +0200
@@ -6,7 +6,7 @@
mc:Ignorable="d"
xmlns:Custom="http://schemas.microsoft.com/surface/2008" xmlns:Microsoft_Surface_Presentation_Generic="clr-namespace:Microsoft.Surface.Presentation.Generic;assembly=Microsoft.Surface.Presentation.Generic"
x:Class="FingersDance.Control.Player.UserControlPlayer"
- x:Name="UserControl"
+ x:Name="UserControl" AllowDrop="True" Custom:SurfaceDragDrop.DragOver="Play_Pause_area_DragOver" Custom:SurfaceDragDrop.DragEnter="Play_Pause_area_DragEnter" Custom:SurfaceDragDrop.DragLeave="Play_Pause_area_DragLeave" Custom:SurfaceDragDrop.Drop="Play_Pause_area_Drop"
Width="560" Height="400">
@@ -125,20 +125,27 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 8d755ba035f9 -r f5108a598aa7 src/FingersDance.Control.Player/UserControlPlayer.xaml.cs
--- 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