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