5 using System.Windows.Controls; |
5 using System.Windows.Controls; |
6 using System.Windows.Data; |
6 using System.Windows.Data; |
7 using System.Windows.Media; |
7 using System.Windows.Media; |
8 using System.Windows.Media.Animation; |
8 using System.Windows.Media.Animation; |
9 using System.Windows.Navigation; |
9 using System.Windows.Navigation; |
|
10 using FingersDance.Control.ListVideo; |
|
11 using FingersDance.Control.SessionInput; |
10 |
12 |
11 namespace FingersDance.Control.Screen |
13 namespace FingersDance.Control.Screen |
12 { |
14 { |
13 public partial class UserControlScreen |
15 public partial class UserControlScreen |
14 { |
16 { |
15 public String contexteGrid; |
17 public String contexteGrid; |
16 public string Path = ""; |
18 public string Path = ""; |
|
19 public event EventHandler UC_Screen_NewSession; |
17 |
20 |
18 public UserControlScreen() |
21 public UserControlScreen() |
19 { |
22 { |
20 this.InitializeComponent(); |
23 this.InitializeComponent(); |
|
24 |
|
25 //1-Creation de la ListVideo |
|
26 UserControlListVideo ListVideo = new UserControlListVideo(); |
|
27 ListVideo.Name = "ListVideo1"; |
21 |
28 |
22 // Insert code required on object creation below this point. |
29 //2-Ajout de la ListVideo au ControlScreen |
|
30 this.AddToGrid(ListVideo); |
|
31 |
|
32 //3-Creation des Events pour chaque item de la video |
|
33 ListVideo.EH_ItemVideo1_ContactDown += new System.EventHandler(this.ListVideo_EH_ItemVideo_ContactDown); |
23 } |
34 } |
24 |
35 |
25 //Rajout un UIElement vers la grid du screen. |
36 //Rajout un UIElement vers la grid du screen. |
26 public void AddToGrid(UIElement uie) |
37 public void AddToGrid(UIElement uie) |
27 { |
38 { |
30 try { LayoutRoot.Children.Add(uie); } |
41 try { LayoutRoot.Children.Add(uie); } |
31 catch(Exception){} |
42 catch(Exception){} |
32 } |
43 } |
33 } |
44 } |
34 |
45 |
35 |
46 private void ListVideo_EH_ItemVideo_ContactDown(object sender, EventArgs e) |
|
47 { |
|
48 |
|
49 //Creation d'un ScatterView Item |
|
50 //ScatterViewItem scatterViewItemSessionInput = new ScatterViewItem(); |
|
51 //scatterViewItemSessionInput.Name = "ScatterViewItemSessionInput"; |
|
52 |
|
53 |
|
54 //1-Creation d'une nouvelle seance. |
|
55 UserControlSessionInput SessionInput = new UserControlSessionInput(); |
|
56 SessionInput.Name = "SessionInput"; |
|
57 |
|
58 try |
|
59 { |
|
60 //2-Recuperer la Grid (Layout root du UC screen)qui contient le UCListVideo et l'ajouter. |
|
61 |
|
62 LayoutRoot.Children.Add(SessionInput); |
|
63 |
|
64 //2.5 rensegner la video choisie au screen |
|
65 this.Path = ((UserControlListVideo)sender).path; |
|
66 //3-Creation des Events |
|
67 SessionInput.EH_SurfaceButtonSubmit_ContactDown += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown); |
|
68 //4-Supression du UC List Video |
|
69 LayoutRoot.Children.Remove((UserControlListVideo)sender); |
|
70 |
|
71 //Init Scatter View Properties and Add it to the scatter view. |
|
72 /*scatterViewItemSessionInput.Content = SessionInput; |
|
73 scatterViewItemSessionInput.CanMove = true; |
|
74 scatterViewItemSessionInput.CanScale = false; |
|
75 scatterViewItemSessionInput.CanRotate = true; |
|
76 scatterViewItemSessionInput.Center = new Point((double)actualGrid.ActualWidth,(double)actualGrid.ActualHeight); |
|
77 scaterview.Items.Add(scatterViewItemSessionInput);*/ |
|
78 } |
|
79 catch (Exception ex) { } |
|
80 } |
|
81 |
|
82 private void SessionInput_EH_SurfaceButtonSubmit_ContactDown(object sender, EventArgs e) |
|
83 { |
|
84 try |
|
85 { |
|
86 //2-Suppression UCSession Input |
|
87 LayoutRoot.Children.Remove((UserControlSessionInput)sender); |
|
88 //3-Suppression du UC Screen |
|
89 if(UC_Screen_NewSession!=null) |
|
90 UC_Screen_NewSession(this, new EventArgs()); |
|
91 } |
|
92 catch (Exception ex) { } |
|
93 } |
36 } |
94 } |
37 } |
95 } |