author | sarias |
Sun, 11 Oct 2009 20:14:02 +0200 | |
changeset 137 | 5a47756f7fb8 |
parent 132 | bc7c039b4bff |
child 139 | 7eb5f979d086 |
permissions | -rw-r--r-- |
45 | 1 |
using System; |
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Windows; |
|
6 |
using System.Windows.Controls; |
|
7 |
using System.Windows.Data; |
|
8 |
using System.Windows.Documents; |
|
9 |
using System.Windows.Input; |
|
10 |
using System.Windows.Media; |
|
11 |
using System.Windows.Media.Imaging; |
|
12 |
using System.Windows.Shapes; |
|
13 |
using System.Windows.Threading; |
|
14 |
using Microsoft.Surface; |
|
15 |
using Microsoft.Surface.Presentation; |
|
16 |
using Microsoft.Surface.Presentation.Controls; |
|
17 |
||
60 | 18 |
using FingersDance.Control.UserPanel; |
82 | 19 |
using FingersDance.Control.Screen; |
131 | 20 |
using FingersDance.Control.Close; |
82 | 21 |
|
60 | 22 |
|
45 | 23 |
namespace FingersDance |
24 |
{ |
|
25 |
/// <summary> |
|
26 |
/// Interaction logic for SurfaceWindow1.xaml |
|
27 |
/// </summary> |
|
28 |
public partial class SurfaceWindow1 : SurfaceWindow |
|
29 |
{ |
|
30 |
/// <summary> |
|
31 |
/// Default constructor. |
|
32 |
/// </summary> |
|
54
c724ac229181
Singleton de la factory
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
45
diff
changeset
|
33 |
/// |
60 | 34 |
#region Variables |
112 | 35 |
private UserControlUserPanel Panel1 = null; |
36 |
private UserControlUserPanel Panel2 = null; |
|
37 |
private UserControlUserPanel Panel3 = null; |
|
38 |
private UserControlUserPanel Panel4 = null; |
|
60 | 39 |
#endregion |
54
c724ac229181
Singleton de la factory
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
45
diff
changeset
|
40 |
|
c724ac229181
Singleton de la factory
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
45
diff
changeset
|
41 |
ActionFactory.ActionGenerator _Factory = new FingersDance.ActionFactory.ActionFactory().GetGenerator(); |
c724ac229181
Singleton de la factory
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
45
diff
changeset
|
42 |
|
45 | 43 |
public SurfaceWindow1() |
44 |
{ |
|
45 |
InitializeComponent(); |
|
46 |
||
60 | 47 |
//Permet d'initialiser l'inertie du Pivot une fois relach�. |
48 |
InitPivotInertia(); |
|
58
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
49 |
//Permet d'initialiser les quand Grid � la position initiale du pivot |
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
50 |
InitGridPositions(); |
45 | 51 |
// Add handlers for Application activation events |
52 |
AddActivationHandlers(); |
|
53 |
} |
|
54 |
||
60 | 55 |
private void InitPivotInertia() |
56 |
{ |
|
57 |
try |
|
58 |
{ |
|
77 | 59 |
ScatterViewItem item = (ScatterViewItem)scaterview.Items.GetItemAt(0); |
60 | 60 |
item.DecelerationRate = double.NaN; |
61 |
} |
|
62 |
catch (Exception ex) { } |
|
63 |
} |
|
64 |
||
58
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
65 |
private void InitGridPositions() |
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
66 |
{ |
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
67 |
//Initialise les 4 Grids � la positions initiale du Pivot. |
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
68 |
try |
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
69 |
{ |
77 | 70 |
ScatterViewItem item = (ScatterViewItem)scaterview.Items.GetItemAt(0); |
58
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
71 |
Grid1.Width =item.Center.X; |
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
72 |
Grid1.Height = item.Center.Y; |
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
73 |
|
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
74 |
Grid2.Width = item.Center.X; |
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
75 |
Grid2.Height = 768 - item.Center.Y; |
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
76 |
|
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
77 |
Grid3.Width = 1024 - item.Center.X; |
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
78 |
Grid3.Height = 768 - item.Center.Y; |
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
79 |
|
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
80 |
Grid4.Width = 1024 - item.Center.X; |
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
81 |
Grid4.Height = item.Center.Y; |
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
82 |
} |
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
83 |
catch (Exception ex) { } |
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
84 |
} |
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
85 |
|
45 | 86 |
|
87 |
/// <summary> |
|
88 |
/// Occurs when the window is about to close. |
|
89 |
/// </summary> |
|
90 |
/// <param name="e"></param> |
|
91 |
protected override void OnClosed(EventArgs e) |
|
92 |
{ |
|
93 |
base.OnClosed(e); |
|
94 |
||
95 |
// Remove handlers for Application activation events |
|
96 |
RemoveActivationHandlers(); |
|
97 |
} |
|
98 |
||
99 |
/// <summary> |
|
100 |
/// Adds handlers for Application activation events. |
|
101 |
/// </summary> |
|
102 |
private void AddActivationHandlers() |
|
103 |
{ |
|
104 |
// Subscribe to surface application activation events |
|
105 |
ApplicationLauncher.ApplicationActivated += OnApplicationActivated; |
|
106 |
ApplicationLauncher.ApplicationPreviewed += OnApplicationPreviewed; |
|
107 |
ApplicationLauncher.ApplicationDeactivated += OnApplicationDeactivated; |
|
108 |
} |
|
109 |
||
110 |
/// <summary> |
|
111 |
/// Removes handlers for Application activation events. |
|
112 |
/// </summary> |
|
113 |
private void RemoveActivationHandlers() |
|
114 |
{ |
|
115 |
// Unsubscribe from surface application activation events |
|
116 |
ApplicationLauncher.ApplicationActivated -= OnApplicationActivated; |
|
117 |
ApplicationLauncher.ApplicationPreviewed -= OnApplicationPreviewed; |
|
118 |
ApplicationLauncher.ApplicationDeactivated -= OnApplicationDeactivated; |
|
119 |
} |
|
120 |
||
121 |
/// <summary> |
|
122 |
/// This is called when application has been activated. |
|
123 |
/// </summary> |
|
124 |
/// <param name="sender"></param> |
|
125 |
/// <param name="e"></param> |
|
126 |
private void OnApplicationActivated(object sender, EventArgs e) |
|
127 |
{ |
|
128 |
//TODO: enable audio, animations here |
|
137
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
129 |
|
45 | 130 |
} |
131 |
||
132 |
/// <summary> |
|
133 |
/// This is called when application is in preview mode. |
|
134 |
/// </summary> |
|
135 |
/// <param name="sender"></param> |
|
136 |
/// <param name="e"></param> |
|
137 |
private void OnApplicationPreviewed(object sender, EventArgs e) |
|
138 |
{ |
|
139 |
//TODO: Disable audio here if it is enabled |
|
140 |
||
141 |
//TODO: optionally enable animations here |
|
142 |
} |
|
143 |
||
144 |
/// <summary> |
|
145 |
/// This is called when application has been deactivated. |
|
146 |
/// </summary> |
|
147 |
/// <param name="sender"></param> |
|
148 |
/// <param name="e"></param> |
|
149 |
private void OnApplicationDeactivated(object sender, EventArgs e) |
|
150 |
{ |
|
151 |
//TODO: disable audio, animations here |
|
152 |
} |
|
153 |
||
137
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
154 |
/// <summary> |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
155 |
/// This is called when application has been loaded, we change the orientation |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
156 |
/// of the application |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
157 |
/// </summary> |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
158 |
/// <param name="sender"></param> |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
159 |
/// <param name="e"></param> |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
160 |
private void mainSurfaceWindow_Loaded(object sender, RoutedEventArgs e) |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
161 |
{ |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
162 |
|
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
163 |
if (ApplicationLauncher.InitialOrientation == UserOrientation.Top) |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
164 |
{ |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
165 |
// Rotate the main canvas by 180 degrees. |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
166 |
this.MainGrid.LayoutTransform = new RotateTransform(180.0); |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
167 |
} |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
168 |
else |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
169 |
{ |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
170 |
// Remove the rotate transform on the main canvas. |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
171 |
this.MainGrid.LayoutTransform = null; |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
172 |
} |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
173 |
// Dismiss the loading screen. |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
174 |
ApplicationLauncher.SignalApplicationLoadComplete(); |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
175 |
} |
5a47756f7fb8
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
176 |
|
77 | 177 |
private void scaterview_ContactChanged(object sender, ContactEventArgs e) |
112 | 178 |
{ } |
77 | 179 |
|
180 |
private void ScatterViewItemPivot_ContactChanged(object sender, ContactEventArgs e) |
|
45 | 181 |
{ |
58
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
182 |
//Permet la MAJ des 4 Grids � la position du pivot |
45 | 183 |
try |
184 |
{ |
|
185 |
Grid1.Width = e.GetPosition(mainSurfaceWindow).X; |
|
186 |
Grid1.Height = e.GetPosition(mainSurfaceWindow).Y; |
|
187 |
||
60 | 188 |
Grid3.Width = e.GetPosition(mainSurfaceWindow).X; |
45 | 189 |
Grid3.Height = 768 - e.GetPosition(mainSurfaceWindow).Y; |
190 |
||
191 |
Grid4.Width = 1024 - e.GetPosition(mainSurfaceWindow).X; |
|
60 | 192 |
Grid4.Height = 768 - e.GetPosition(mainSurfaceWindow).Y; |
193 |
||
194 |
Grid2.Width = 1024 - e.GetPosition(mainSurfaceWindow).X; |
|
195 |
Grid2.Height = e.GetPosition(mainSurfaceWindow).Y; |
|
89 | 196 |
|
91 | 197 |
//GRISAGE |
198 |
//Grid1 |
|
199 |
if (Grid1.Width < (1024 / 4) || Grid2.Height < (768 / 4)) |
|
89 | 200 |
{ |
91 | 201 |
try |
202 |
{Grid1.Children[1].Visibility = Visibility.Hidden;} |
|
203 |
catch (Exception) { } |
|
89 | 204 |
} |
91 | 205 |
else |
206 |
{ |
|
207 |
try |
|
208 |
{ Grid1.Children[1].Visibility = Visibility.Visible; } |
|
209 |
catch (Exception) { } |
|
210 |
} |
|
211 |
//Grid2 |
|
212 |
if (Grid2.Width < (1024 / 4) || Grid2.Height < (768 / 4)) |
|
89 | 213 |
{ |
91 | 214 |
try |
215 |
{ Grid2.Children[1].Visibility = Visibility.Hidden; } |
|
216 |
catch (Exception) { } |
|
217 |
} |
|
218 |
else |
|
219 |
{ |
|
220 |
try |
|
221 |
{ Grid2.Children[1].Visibility = Visibility.Visible; } |
|
222 |
catch (Exception) { } |
|
89 | 223 |
} |
91 | 224 |
//Grid3 |
225 |
if (Grid3.Width < (1024 / 4) || Grid3.Height < (768 / 4)) |
|
89 | 226 |
{ |
91 | 227 |
try |
228 |
{ Grid3.Children[1].Visibility = Visibility.Hidden; } |
|
229 |
catch (Exception) { } |
|
230 |
} |
|
231 |
else |
|
232 |
{ |
|
233 |
try |
|
234 |
{ Grid3.Children[1].Visibility = Visibility.Visible; } |
|
235 |
catch (Exception) { } |
|
89 | 236 |
} |
91 | 237 |
//Grid4 |
238 |
if (Grid4.Width < (1024 / 4) || Grid4.Height < (768 / 4)) |
|
89 | 239 |
{ |
91 | 240 |
try |
241 |
{ Grid4.Children[1].Visibility = Visibility.Hidden; } |
|
242 |
catch (Exception) { } |
|
89 | 243 |
} |
91 | 244 |
else |
245 |
{ |
|
246 |
try |
|
247 |
{ Grid4.Children[1].Visibility = Visibility.Visible; } |
|
248 |
catch (Exception) { } |
|
249 |
} |
|
45 | 250 |
} |
91 | 251 |
catch (Exception) { } |
45 | 252 |
} |
60 | 253 |
|
112 | 254 |
private void UserControlPivot_EH_SurfaceButtonPlayer_ContactDown(object sender, EventArgs e) |
60 | 255 |
{ |
112 | 256 |
switch ((int)sender) |
60 | 257 |
{ |
112 | 258 |
case 1: |
132 | 259 |
if (Panel1 == null && Grid1.Children.Count == 1) |
112 | 260 |
{ |
261 |
//1-Creation du control Screen |
|
262 |
UserControlScreen Screen = new UserControlScreen(1); |
|
263 |
Screen.Name = "Screen1"; |
|
264 |
Screen.contexteGrid = Grid1.Name.ToString(); |
|
265 |
//2-Rajout du screen dans la grid correspondante |
|
266 |
Grid1.Children.Add(Screen); |
|
267 |
||
268 |
Screen.UC_Screen_NewSession += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown); |
|
269 |
} |
|
131 | 270 |
else //Affichage du message de confirmation |
271 |
{ |
|
132 | 272 |
if (Panel1 != null && Grid1.Children.Count == 2) |
273 |
{ |
|
274 |
UserControlClose UCclose = new UserControlClose(1); |
|
275 |
UCclose.Name = "CloseAlert1"; |
|
276 |
Grid1.Children.Add(UCclose); |
|
277 |
UCclose.EH_SurfaceButtonClose_ContactDown += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); |
|
278 |
} |
|
131 | 279 |
} |
112 | 280 |
break; |
281 |
case 2: |
|
132 | 282 |
if (Panel2 == null && Grid2.Children.Count == 1) |
112 | 283 |
{ |
284 |
//1-Creation du control Screen |
|
285 |
UserControlScreen Screen = new UserControlScreen(2); |
|
286 |
Screen.Name = "Screen2"; |
|
287 |
Screen.contexteGrid = Grid2.Name.ToString(); |
|
288 |
//2-Rajout du screen dans la grid correspondante |
|
289 |
Grid2.Children.Add(Screen); |
|
72
f1ca0958c992
Travail sur le control List Video et comunication entre ListVideo et FingersDance
sarias
parents:
60
diff
changeset
|
290 |
|
112 | 291 |
Screen.UC_Screen_NewSession += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown); |
292 |
} |
|
131 | 293 |
else //Affichage du message de confirmation |
294 |
{ |
|
132 | 295 |
if (Panel2 != null && Grid2.Children.Count == 2) |
296 |
{ |
|
297 |
UserControlClose UCclose = new UserControlClose(2); |
|
298 |
UCclose.Name = "CloseAlert2"; |
|
299 |
Grid2.Children.Add(UCclose); |
|
300 |
UCclose.EH_SurfaceButtonClose_ContactDown += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); |
|
301 |
} |
|
131 | 302 |
} |
112 | 303 |
break; |
304 |
case 3: |
|
132 | 305 |
if (Panel3 == null && Grid3.Children.Count == 1) |
112 | 306 |
{ |
307 |
//1-Creation du control Screen |
|
308 |
UserControlScreen Screen = new UserControlScreen(3); |
|
309 |
Screen.Name = "Screen3"; |
|
310 |
Screen.contexteGrid = Grid3.Name.ToString(); |
|
311 |
//2-Rajout du screen dans la grid correspondante |
|
312 |
Grid3.Children.Add(Screen); |
|
72
f1ca0958c992
Travail sur le control List Video et comunication entre ListVideo et FingersDance
sarias
parents:
60
diff
changeset
|
313 |
|
112 | 314 |
Screen.UC_Screen_NewSession += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown); |
315 |
} |
|
131 | 316 |
else //Affichage du message de confirmation |
317 |
{ |
|
132 | 318 |
if (Panel3 != null && Grid3.Children.Count == 2) |
319 |
{ |
|
320 |
UserControlClose UCclose = new UserControlClose(3); |
|
321 |
UCclose.Name = "CloseAlert3"; |
|
322 |
Grid3.Children.Add(UCclose); |
|
323 |
UCclose.EH_SurfaceButtonClose_ContactDown += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); |
|
324 |
} |
|
131 | 325 |
} |
112 | 326 |
break; |
327 |
case 4: |
|
132 | 328 |
if (Panel4 == null && Grid4.Children.Count == 1) |
112 | 329 |
{ |
330 |
//1-Creation du control Screen |
|
331 |
UserControlScreen Screen = new UserControlScreen(4); |
|
332 |
Screen.Name = "Screen4"; |
|
333 |
Screen.contexteGrid = Grid4.Name.ToString(); |
|
334 |
//2-Rajout du screen dans la grid correspondante |
|
335 |
Grid4.Children.Add(Screen); |
|
336 |
||
337 |
Screen.UC_Screen_NewSession += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown); |
|
338 |
} |
|
131 | 339 |
else //Affichage du message de confirmation |
340 |
{ |
|
132 | 341 |
if (Panel4 != null && Grid4.Children.Count == 2) |
342 |
{ |
|
343 |
UserControlClose UCclose = new UserControlClose(4); |
|
344 |
UCclose.Name = "CloseAlert4"; |
|
345 |
Grid4.Children.Add(UCclose); |
|
346 |
UCclose.EH_SurfaceButtonClose_ContactDown += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); |
|
347 |
} |
|
131 | 348 |
} |
112 | 349 |
break; |
350 |
} |
|
351 |
|
|
73 | 352 |
} |
72
f1ca0958c992
Travail sur le control List Video et comunication entre ListVideo et FingersDance
sarias
parents:
60
diff
changeset
|
353 |
|
73 | 354 |
//Button Submit du control SessionInput |
355 |
private void SessionInput_EH_SurfaceButtonSubmit_ContactDown(object sender, EventArgs e) |
|
356 |
{ |
|
357 |
try |
|
358 |
{ |
|
112 | 359 |
//1-Suppression du UC Screen |
104 | 360 |
Grid root = (Grid)(((UserControlScreen)sender).Parent); |
361 |
root.Children.Remove(((UserControlScreen)sender)); |
|
112 | 362 |
//2-Creation du User Panel |
363 |
switch (((UserControlScreen)sender).id) |
|
364 |
{ |
|
365 |
case 1: |
|
119 | 366 |
Panel1 = new UserControlUserPanel(((UserControlScreen)sender).Path); |
112 | 367 |
Panel1.Name = "UserPanel1"; |
368 |
//3-Rajout sur la Grid Root |
|
369 |
root.Children.Add(Panel1); |
|
370 |
break; |
|
371 |
case 2: |
|
119 | 372 |
Panel2 = new UserControlUserPanel(((UserControlScreen)sender).Path); |
112 | 373 |
Panel2.Name = "UserPanel2"; |
374 |
//3-Rajout sur la Grid Root |
|
375 |
root.Children.Add(Panel2); |
|
376 |
break; |
|
377 |
case 3: |
|
119 | 378 |
Panel3 = new UserControlUserPanel(((UserControlScreen)sender).Path); |
112 | 379 |
Panel3.Name = "UserPanel3"; |
380 |
//3-Rajout sur la Grid Root |
|
381 |
root.Children.Add(Panel3); |
|
382 |
break; |
|
383 |
case 4: |
|
119 | 384 |
Panel4 = new UserControlUserPanel(((UserControlScreen)sender).Path); |
112 | 385 |
Panel4.Name = "UserPanel4"; |
386 |
//3-Rajout sur la Grid Root |
|
387 |
root.Children.Add(Panel4); |
|
388 |
break; |
|
389 |
} |
|
73 | 390 |
} |
391 |
catch (Exception ex) { } |
|
72
f1ca0958c992
Travail sur le control List Video et comunication entre ListVideo et FingersDance
sarias
parents:
60
diff
changeset
|
392 |
} |
73 | 393 |
|
131 | 394 |
//Actions du boutton Alert selon l'action close OK ou NON |
395 |
private void CloseAlert_EH_SurfaceButton_ContactDown(object sender, EventArgs e) |
|
396 |
{ |
|
397 |
Grid root = (Grid)(((UserControlClose)sender).Parent); |
|
398 |
if(((UserControlClose) sender).close) |
|
399 |
{ |
|
400 |
switch(((UserControlClose)sender).Id) |
|
401 |
{ |
|
402 |
case 1: |
|
403 |
root.Children.Remove(Panel1); |
|
132 | 404 |
Panel1 = null; |
131 | 405 |
break; |
406 |
case 2: |
|
407 |
root.Children.Remove(Panel2); |
|
132 | 408 |
Panel2 = null; |
131 | 409 |
break; |
410 |
case 3: |
|
411 |
root.Children.Remove(Panel3); |
|
132 | 412 |
Panel3 = null; |
131 | 413 |
break; |
414 |
case 4: |
|
415 |
root.Children.Remove(Panel4); |
|
132 | 416 |
Panel4 = null; |
131 | 417 |
break; |
418 |
} |
|
419 |
} |
|
420 |
root.Children.Remove(((UserControlClose)sender)); |
|
421 |
} |
|
77 | 422 |
|
45 | 423 |
} |
424 |
} |