src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs
changeset 74 7ce946833eae
parent 69 a4c44555f205
child 75 99d003723474
--- a/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs	Wed Sep 16 19:32:26 2009 +0200
+++ b/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs	Thu Sep 17 13:06:22 2009 +0200
@@ -30,6 +30,11 @@
         public event EventHandler DragCompleted;
         public event EventHandler TimerTick;
 
+        private List<Annotation> annotList = new List<Annotation>();
+        private float annotWidth = 40;
+        private CuttingViewModel cutvm;
+        private int numAnnot = 1;
+
         #region Properties
 
         public SurfaceSlider Slider
@@ -85,7 +90,7 @@
 
         
 		public UserControlTimeLine()
-		{
+		{   
 			this.InitializeComponent();
 
 			// Insert code required on object creation below this point.
@@ -98,15 +103,24 @@
 
 
             // TEMP FOR DATA BINDING
-            List<Annotation> annotList = new List<Annotation>();
+            annotList = new List<Annotation>();
             annotList.Add(new Annotation(0, 10, "Axe Cam 1"));
-            annotList.Add(new Annotation(10, 20, "Mvt Cam 2"));
-            annotList.Add(new Annotation(30, 40, "Saut 3"));
+            annotList.Add(new Annotation(20 - (1 * annotWidth), 30, "Mvt Cam 2"));
+            annotList.Add(new Annotation(50 - (2 * annotWidth), 60, "Saut 3"));
+            annotList.Add(new Annotation(100 - (3 * annotWidth), 20, "Saut 4"));
+            annotList.Add(new Annotation(120 - (4 * annotWidth), 50, "Saut 5"));
             Cutting cut = new Cutting("titre de cutting", annotList);
-            CuttingViewModel cutvm = new CuttingViewModel(cut);
-            tv.DataContext = cut;
+            cutvm = new CuttingViewModel(cut);
+            tv.DataContext = cutvm;
 
-
+            numAnnot = 6;
+            slider_ContactTapGesture(this,null);
+            /*
+            cutvm.AnnotList.Add(new AnnotationViewModel(new Annotation(180 - (5 * annotWidth), 10, "6")));
+            tv.DataContext = null;
+            tv.DataContext = cutvm;
+            numAnnot = 7;
+            */
         }
 
         #region Timer
@@ -172,5 +186,15 @@
                 DragCompleted(this, new EventArgs());
         }
 
+        private void slider_ContactTapGesture(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
+        {
+
+            cutvm.AnnotList.Add(new AnnotationViewModel(new Annotation(180+(numAnnot-6)*20 - ((numAnnot-1) * annotWidth), 10, numAnnot.ToString())));
+            tv.DataContext = null;
+            tv.DataContext = cutvm;
+            numAnnot++;
+        }
+        
+
 	}
 }
\ No newline at end of file