28 |
28 |
29 public event EventHandler DragStarted; |
29 public event EventHandler DragStarted; |
30 public event EventHandler DragCompleted; |
30 public event EventHandler DragCompleted; |
31 public event EventHandler TimerTick; |
31 public event EventHandler TimerTick; |
32 |
32 |
|
33 private List<Annotation> annotList = new List<Annotation>(); |
|
34 private float annotWidth = 40; |
|
35 private CuttingViewModel cutvm; |
|
36 private int numAnnot = 1; |
|
37 |
33 #region Properties |
38 #region Properties |
34 |
39 |
35 public SurfaceSlider Slider |
40 public SurfaceSlider Slider |
36 { |
41 { |
37 get |
42 get |
96 { |
101 { |
97 slider.Maximum = totalmilliseconds; |
102 slider.Maximum = totalmilliseconds; |
98 |
103 |
99 |
104 |
100 // TEMP FOR DATA BINDING |
105 // TEMP FOR DATA BINDING |
101 List<Annotation> annotList = new List<Annotation>(); |
106 annotList = new List<Annotation>(); |
102 annotList.Add(new Annotation(0, 10, "Axe Cam 1")); |
107 annotList.Add(new Annotation(0, 10, "Axe Cam 1")); |
103 annotList.Add(new Annotation(10, 20, "Mvt Cam 2")); |
108 annotList.Add(new Annotation(20 - (1 * annotWidth), 30, "Mvt Cam 2")); |
104 annotList.Add(new Annotation(30, 40, "Saut 3")); |
109 annotList.Add(new Annotation(50 - (2 * annotWidth), 60, "Saut 3")); |
|
110 annotList.Add(new Annotation(100 - (3 * annotWidth), 20, "Saut 4")); |
|
111 annotList.Add(new Annotation(120 - (4 * annotWidth), 50, "Saut 5")); |
105 Cutting cut = new Cutting("titre de cutting", annotList); |
112 Cutting cut = new Cutting("titre de cutting", annotList); |
106 CuttingViewModel cutvm = new CuttingViewModel(cut); |
113 cutvm = new CuttingViewModel(cut); |
107 tv.DataContext = cut; |
114 tv.DataContext = cutvm; |
108 |
115 |
109 |
116 numAnnot = 6; |
|
117 slider_ContactTapGesture(this,null); |
|
118 /* |
|
119 cutvm.AnnotList.Add(new AnnotationViewModel(new Annotation(180 - (5 * annotWidth), 10, "6"))); |
|
120 tv.DataContext = null; |
|
121 tv.DataContext = cutvm; |
|
122 numAnnot = 7; |
|
123 */ |
110 } |
124 } |
111 |
125 |
112 #region Timer |
126 #region Timer |
113 public void initTimer() |
127 public void initTimer() |
114 { |
128 { |
170 { |
184 { |
171 if (DragCompleted != null) |
185 if (DragCompleted != null) |
172 DragCompleted(this, new EventArgs()); |
186 DragCompleted(this, new EventArgs()); |
173 } |
187 } |
174 |
188 |
|
189 private void slider_ContactTapGesture(object sender, Microsoft.Surface.Presentation.ContactEventArgs e) |
|
190 { |
|
191 |
|
192 cutvm.AnnotList.Add(new AnnotationViewModel(new Annotation(180+(numAnnot-6)*20 - ((numAnnot-1) * annotWidth), 10, numAnnot.ToString()))); |
|
193 tv.DataContext = null; |
|
194 tv.DataContext = cutvm; |
|
195 numAnnot++; |
|
196 } |
|
197 |
|
198 |
175 } |
199 } |
176 } |
200 } |