16 using Microsoft.Surface.Presentation.Controls; |
16 using Microsoft.Surface.Presentation.Controls; |
17 |
17 |
18 using FingersDance.Control.UserPanel; |
18 using FingersDance.Control.UserPanel; |
19 using FingersDance.Control.ListVideo; |
19 using FingersDance.Control.ListVideo; |
20 using FingersDance.Control.SessionInput; |
20 using FingersDance.Control.SessionInput; |
|
21 using FingersDance.Control.Screen; |
|
22 |
21 |
23 |
22 namespace FingersDance |
24 namespace FingersDance |
23 { |
25 { |
24 /// <summary> |
26 /// <summary> |
25 /// Interaction logic for SurfaceWindow1.xaml |
27 /// Interaction logic for SurfaceWindow1.xaml |
192 private void UserControlPivot_EH_SurfaceButtonPlayer1_ContactDown(object sender, EventArgs e) |
194 private void UserControlPivot_EH_SurfaceButtonPlayer1_ContactDown(object sender, EventArgs e) |
193 { |
195 { |
194 |
196 |
195 if (!isCreatedP1) |
197 if (!isCreatedP1) |
196 { |
198 { |
|
199 //1-Creation du control Screen |
|
200 UserControlScreen Screen1 = new UserControlScreen(); |
|
201 Screen1.Name = "Screen1"; |
|
202 Screen1.contexteGrid = Grid1.Name.ToString(); |
|
203 //2-Rajout du screen dans la grid correspondante |
|
204 Grid1.Children.Add(Screen1); |
|
205 |
|
206 //3-Creation de la ListVideo |
197 UserControlListVideo ListVideo1 = new UserControlListVideo(); |
207 UserControlListVideo ListVideo1 = new UserControlListVideo(); |
198 ListVideo1.Name = "ListVideo1"; |
208 ListVideo1.Name = "ListVideo1"; |
199 |
209 |
200 Grid1.Children.Add(ListVideo1); |
210 //4-Ajout de la ListVideo au ControlScreen |
201 |
211 Screen1.AddToGrid(ListVideo1); |
202 //Creation des Events pour chaque item de la video |
212 |
|
213 //5-Creation des Events pour chaque item de la video |
203 ListVideo1.EH_ItemVideo1_ContactDown += new System.EventHandler(this.ListVideo1_EH_ItemVideo1_ContactDown); |
214 ListVideo1.EH_ItemVideo1_ContactDown += new System.EventHandler(this.ListVideo1_EH_ItemVideo1_ContactDown); |
204 ListVideo1.EH_ItemVideo2_ContactDown += new System.EventHandler(this.ListVideo1_EH_ItemVideo2_ContactDown); |
215 ListVideo1.EH_ItemVideo2_ContactDown += new System.EventHandler(this.ListVideo1_EH_ItemVideo2_ContactDown); |
205 /* |
216 |
206 UserControlUserPanel UserPanel1 = new UserControlUserPanel(); |
|
207 UserPanel1.Name = "UserPanel1"; |
|
208 Grid1.Children.Add(UserPanel1); |
|
209 isCreatedP1 = true;*/ |
|
210 } |
217 } |
211 } |
218 } |
212 |
219 |
213 private void UserControlPivot_EH_SurfaceButtonPlayer2_ContactDown(object sender, EventArgs e) |
220 private void UserControlPivot_EH_SurfaceButtonPlayer2_ContactDown(object sender, EventArgs e) |
214 { |
221 { |
249 //Creation d'un ScatterView Item |
256 //Creation d'un ScatterView Item |
250 //ScatterViewItem scatterViewItemSessionInput = new ScatterViewItem(); |
257 //ScatterViewItem scatterViewItemSessionInput = new ScatterViewItem(); |
251 //scatterViewItemSessionInput.Name = "ScatterViewItemSessionInput"; |
258 //scatterViewItemSessionInput.Name = "ScatterViewItemSessionInput"; |
252 |
259 |
253 |
260 |
254 //Creation d'une nouvelle seance. |
261 //1-Creation d'une nouvelle seance. |
255 |
|
256 UserControlSessionInput SessionInput = new UserControlSessionInput(); |
262 UserControlSessionInput SessionInput = new UserControlSessionInput(); |
257 SessionInput.Name = "SessionInput"; |
263 SessionInput.Name = "SessionInput"; |
258 |
264 |
259 try{ |
265 try{ |
|
266 //2-Recuperer la Grid qui contient le UCListVideo et l'ajouter. |
260 Grid actualGrid = (Grid)(((UserControlListVideo)sender).Parent); |
267 Grid actualGrid = (Grid)(((UserControlListVideo)sender).Parent); |
261 actualGrid.Children.Add(SessionInput); |
268 actualGrid.Children.Add(SessionInput); |
262 |
269 |
|
270 //3-Creation des Events |
263 SessionInput.EH_SurfaceButtonSubmit_ContactDown += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown); |
271 SessionInput.EH_SurfaceButtonSubmit_ContactDown += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown); |
|
272 //4-Supression du UC List Video |
264 actualGrid.Children.Remove((UserControlListVideo)sender); |
273 actualGrid.Children.Remove((UserControlListVideo)sender); |
|
274 |
265 |
275 |
266 //Init Scatter View Properties and Add it to the scatter view. |
276 //Init Scatter View Properties and Add it to the scatter view. |
267 /*scatterViewItemSessionInput.Content = SessionInput; |
277 /*scatterViewItemSessionInput.Content = SessionInput; |
268 scatterViewItemSessionInput.CanMove = true; |
278 scatterViewItemSessionInput.CanMove = true; |
269 scatterViewItemSessionInput.CanScale = false; |
279 scatterViewItemSessionInput.CanScale = false; |
283 //Button Submit du control SessionInput |
293 //Button Submit du control SessionInput |
284 private void SessionInput_EH_SurfaceButtonSubmit_ContactDown(object sender, EventArgs e) |
294 private void SessionInput_EH_SurfaceButtonSubmit_ContactDown(object sender, EventArgs e) |
285 { |
295 { |
286 try |
296 try |
287 { |
297 { |
|
298 //1-Recuperation de actualGrid (LayoutRoot du UC Screen) |
288 Grid actualGrid = (Grid)(((UserControlSessionInput)sender).Parent); |
299 Grid actualGrid = (Grid)(((UserControlSessionInput)sender).Parent); |
|
300 //2-Suppression UCSession Input |
289 actualGrid.Children.Remove((UserControlSessionInput)sender); |
301 actualGrid.Children.Remove((UserControlSessionInput)sender); |
290 //Creation du User Panel |
302 //3-Suppression du UC Screen |
|
303 Grid root = (Grid) ((UserControlScreen)actualGrid.Parent).Parent; |
|
304 root.Children.Remove((UserControlScreen)actualGrid.Parent); |
|
305 //4-Creation du User Panel |
291 UserControlUserPanel UserPanel1 = new UserControlUserPanel(); |
306 UserControlUserPanel UserPanel1 = new UserControlUserPanel(); |
292 UserPanel1.Name = "UserPanel1"; |
307 UserPanel1.Name = "UserPanel1"; |
293 actualGrid.Children.Add(UserPanel1); |
308 //5-Rajout sur la Grid Root |
|
309 root.Children.Add(UserPanel1); |
294 |
310 |
295 } |
311 } |
296 catch (Exception ex) { } |
312 catch (Exception ex) { } |
297 } |
313 } |
298 |
314 |