author | sarias |
Sun, 11 Oct 2009 20:34:56 +0200 | |
changeset 138 | 61ba19954ed4 |
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> |
|
138
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
88 |
/// CopyTo rotate the layout based on the suggested orientation |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
89 |
/// </summary> |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
90 |
/// <param name="e"></param> |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
91 |
private void MainGrid_Loaded(object sender, RoutedEventArgs e) |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
92 |
{ |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
93 |
if (ApplicationLauncher.InitialOrientation == UserOrientation.Top) |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
94 |
{ |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
95 |
// Rotate the main canvas by 180 degrees. |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
96 |
this.MainGrid.LayoutTransform = new RotateTransform(180.0); |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
97 |
} |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
98 |
else |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
99 |
{ |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
100 |
// Remove the rotate transform on the main canvas. |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
101 |
this.MainGrid.LayoutTransform = null; |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
102 |
} |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
103 |
// Dismiss the loading screen. |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
104 |
ApplicationLauncher.SignalApplicationLoadComplete(); |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
105 |
} |
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
106 |
|
61ba19954ed4
To rotate the layout based on the suggested orientation
sarias
parents:
132
diff
changeset
|
107 |
/// <summary> |
45 | 108 |
/// Occurs when the window is about to close. |
109 |
/// </summary> |
|
110 |
/// <param name="e"></param> |
|
111 |
protected override void OnClosed(EventArgs e) |
|
112 |
{ |
|
113 |
base.OnClosed(e); |
|
114 |
||
115 |
// Remove handlers for Application activation events |
|
116 |
RemoveActivationHandlers(); |
|
117 |
} |
|
118 |
||
119 |
/// <summary> |
|
120 |
/// Adds handlers for Application activation events. |
|
121 |
/// </summary> |
|
122 |
private void AddActivationHandlers() |
|
123 |
{ |
|
124 |
// Subscribe to surface application activation events |
|
125 |
ApplicationLauncher.ApplicationActivated += OnApplicationActivated; |
|
126 |
ApplicationLauncher.ApplicationPreviewed += OnApplicationPreviewed; |
|
127 |
ApplicationLauncher.ApplicationDeactivated += OnApplicationDeactivated; |
|
128 |
} |
|
129 |
||
130 |
/// <summary> |
|
131 |
/// Removes handlers for Application activation events. |
|
132 |
/// </summary> |
|
133 |
private void RemoveActivationHandlers() |
|
134 |
{ |
|
135 |
// Unsubscribe from surface application activation events |
|
136 |
ApplicationLauncher.ApplicationActivated -= OnApplicationActivated; |
|
137 |
ApplicationLauncher.ApplicationPreviewed -= OnApplicationPreviewed; |
|
138 |
ApplicationLauncher.ApplicationDeactivated -= OnApplicationDeactivated; |
|
139 |
} |
|
140 |
||
141 |
/// <summary> |
|
142 |
/// This is called when application has been activated. |
|
143 |
/// </summary> |
|
144 |
/// <param name="sender"></param> |
|
145 |
/// <param name="e"></param> |
|
146 |
private void OnApplicationActivated(object sender, EventArgs e) |
|
147 |
{ |
|
148 |
//TODO: enable audio, animations here |
|
149 |
} |
|
150 |
||
151 |
/// <summary> |
|
152 |
/// This is called when application is in preview mode. |
|
153 |
/// </summary> |
|
154 |
/// <param name="sender"></param> |
|
155 |
/// <param name="e"></param> |
|
156 |
private void OnApplicationPreviewed(object sender, EventArgs e) |
|
157 |
{ |
|
158 |
//TODO: Disable audio here if it is enabled |
|
159 |
||
160 |
//TODO: optionally enable animations here |
|
161 |
} |
|
162 |
||
163 |
/// <summary> |
|
164 |
/// This is called when application has been deactivated. |
|
165 |
/// </summary> |
|
166 |
/// <param name="sender"></param> |
|
167 |
/// <param name="e"></param> |
|
168 |
private void OnApplicationDeactivated(object sender, EventArgs e) |
|
169 |
{ |
|
170 |
//TODO: disable audio, animations here |
|
171 |
} |
|
172 |
||
77 | 173 |
private void scaterview_ContactChanged(object sender, ContactEventArgs e) |
112 | 174 |
{ } |
77 | 175 |
|
176 |
private void ScatterViewItemPivot_ContactChanged(object sender, ContactEventArgs e) |
|
45 | 177 |
{ |
58
d7313fb1806c
Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents:
54
diff
changeset
|
178 |
//Permet la MAJ des 4 Grids � la position du pivot |
45 | 179 |
try |
180 |
{ |
|
181 |
Grid1.Width = e.GetPosition(mainSurfaceWindow).X; |
|
182 |
Grid1.Height = e.GetPosition(mainSurfaceWindow).Y; |
|
183 |
||
60 | 184 |
Grid3.Width = e.GetPosition(mainSurfaceWindow).X; |
45 | 185 |
Grid3.Height = 768 - e.GetPosition(mainSurfaceWindow).Y; |
186 |
||
187 |
Grid4.Width = 1024 - e.GetPosition(mainSurfaceWindow).X; |
|
60 | 188 |
Grid4.Height = 768 - e.GetPosition(mainSurfaceWindow).Y; |
189 |
||
190 |
Grid2.Width = 1024 - e.GetPosition(mainSurfaceWindow).X; |
|
191 |
Grid2.Height = e.GetPosition(mainSurfaceWindow).Y; |
|
89 | 192 |
|
91 | 193 |
//GRISAGE |
194 |
//Grid1 |
|
195 |
if (Grid1.Width < (1024 / 4) || Grid2.Height < (768 / 4)) |
|
89 | 196 |
{ |
91 | 197 |
try |
198 |
{Grid1.Children[1].Visibility = Visibility.Hidden;} |
|
199 |
catch (Exception) { } |
|
89 | 200 |
} |
91 | 201 |
else |
202 |
{ |
|
203 |
try |
|
204 |
{ Grid1.Children[1].Visibility = Visibility.Visible; } |
|
205 |
catch (Exception) { } |
|
206 |
} |
|
207 |
//Grid2 |
|
208 |
if (Grid2.Width < (1024 / 4) || Grid2.Height < (768 / 4)) |
|
89 | 209 |
{ |
91 | 210 |
try |
211 |
{ Grid2.Children[1].Visibility = Visibility.Hidden; } |
|
212 |
catch (Exception) { } |
|
213 |
} |
|
214 |
else |
|
215 |
{ |
|
216 |
try |
|
217 |
{ Grid2.Children[1].Visibility = Visibility.Visible; } |
|
218 |
catch (Exception) { } |
|
89 | 219 |
} |
91 | 220 |
//Grid3 |
221 |
if (Grid3.Width < (1024 / 4) || Grid3.Height < (768 / 4)) |
|
89 | 222 |
{ |
91 | 223 |
try |
224 |
{ Grid3.Children[1].Visibility = Visibility.Hidden; } |
|
225 |
catch (Exception) { } |
|
226 |
} |
|
227 |
else |
|
228 |
{ |
|
229 |
try |
|
230 |
{ Grid3.Children[1].Visibility = Visibility.Visible; } |
|
231 |
catch (Exception) { } |
|
89 | 232 |
} |
91 | 233 |
//Grid4 |
234 |
if (Grid4.Width < (1024 / 4) || Grid4.Height < (768 / 4)) |
|
89 | 235 |
{ |
91 | 236 |
try |
237 |
{ Grid4.Children[1].Visibility = Visibility.Hidden; } |
|
238 |
catch (Exception) { } |
|
89 | 239 |
} |
91 | 240 |
else |
241 |
{ |
|
242 |
try |
|
243 |
{ Grid4.Children[1].Visibility = Visibility.Visible; } |
|
244 |
catch (Exception) { } |
|
245 |
} |
|
45 | 246 |
} |
91 | 247 |
catch (Exception) { } |
45 | 248 |
} |
60 | 249 |
|
112 | 250 |
private void UserControlPivot_EH_SurfaceButtonPlayer_ContactDown(object sender, EventArgs e) |
60 | 251 |
{ |
112 | 252 |
switch ((int)sender) |
60 | 253 |
{ |
112 | 254 |
case 1: |
132 | 255 |
if (Panel1 == null && Grid1.Children.Count == 1) |
112 | 256 |
{ |
257 |
//1-Creation du control Screen |
|
258 |
UserControlScreen Screen = new UserControlScreen(1); |
|
259 |
Screen.Name = "Screen1"; |
|
260 |
Screen.contexteGrid = Grid1.Name.ToString(); |
|
261 |
//2-Rajout du screen dans la grid correspondante |
|
262 |
Grid1.Children.Add(Screen); |
|
263 |
||
264 |
Screen.UC_Screen_NewSession += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown); |
|
265 |
} |
|
131 | 266 |
else //Affichage du message de confirmation |
267 |
{ |
|
132 | 268 |
if (Panel1 != null && Grid1.Children.Count == 2) |
269 |
{ |
|
270 |
UserControlClose UCclose = new UserControlClose(1); |
|
271 |
UCclose.Name = "CloseAlert1"; |
|
272 |
Grid1.Children.Add(UCclose); |
|
273 |
UCclose.EH_SurfaceButtonClose_ContactDown += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); |
|
274 |
} |
|
131 | 275 |
} |
112 | 276 |
break; |
277 |
case 2: |
|
132 | 278 |
if (Panel2 == null && Grid2.Children.Count == 1) |
112 | 279 |
{ |
280 |
//1-Creation du control Screen |
|
281 |
UserControlScreen Screen = new UserControlScreen(2); |
|
282 |
Screen.Name = "Screen2"; |
|
283 |
Screen.contexteGrid = Grid2.Name.ToString(); |
|
284 |
//2-Rajout du screen dans la grid correspondante |
|
285 |
Grid2.Children.Add(Screen); |
|
72
f1ca0958c992
Travail sur le control List Video et comunication entre ListVideo et FingersDance
sarias
parents:
60
diff
changeset
|
286 |
|
112 | 287 |
Screen.UC_Screen_NewSession += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown); |
288 |
} |
|
131 | 289 |
else //Affichage du message de confirmation |
290 |
{ |
|
132 | 291 |
if (Panel2 != null && Grid2.Children.Count == 2) |
292 |
{ |
|
293 |
UserControlClose UCclose = new UserControlClose(2); |
|
294 |
UCclose.Name = "CloseAlert2"; |
|
295 |
Grid2.Children.Add(UCclose); |
|
296 |
UCclose.EH_SurfaceButtonClose_ContactDown += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); |
|
297 |
} |
|
131 | 298 |
} |
112 | 299 |
break; |
300 |
case 3: |
|
132 | 301 |
if (Panel3 == null && Grid3.Children.Count == 1) |
112 | 302 |
{ |
303 |
//1-Creation du control Screen |
|
304 |
UserControlScreen Screen = new UserControlScreen(3); |
|
305 |
Screen.Name = "Screen3"; |
|
306 |
Screen.contexteGrid = Grid3.Name.ToString(); |
|
307 |
//2-Rajout du screen dans la grid correspondante |
|
308 |
Grid3.Children.Add(Screen); |
|
72
f1ca0958c992
Travail sur le control List Video et comunication entre ListVideo et FingersDance
sarias
parents:
60
diff
changeset
|
309 |
|
112 | 310 |
Screen.UC_Screen_NewSession += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown); |
311 |
} |
|
131 | 312 |
else //Affichage du message de confirmation |
313 |
{ |
|
132 | 314 |
if (Panel3 != null && Grid3.Children.Count == 2) |
315 |
{ |
|
316 |
UserControlClose UCclose = new UserControlClose(3); |
|
317 |
UCclose.Name = "CloseAlert3"; |
|
318 |
Grid3.Children.Add(UCclose); |
|
319 |
UCclose.EH_SurfaceButtonClose_ContactDown += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); |
|
320 |
} |
|
131 | 321 |
} |
112 | 322 |
break; |
323 |
case 4: |
|
132 | 324 |
if (Panel4 == null && Grid4.Children.Count == 1) |
112 | 325 |
{ |
326 |
//1-Creation du control Screen |
|
327 |
UserControlScreen Screen = new UserControlScreen(4); |
|
328 |
Screen.Name = "Screen4"; |
|
329 |
Screen.contexteGrid = Grid4.Name.ToString(); |
|
330 |
//2-Rajout du screen dans la grid correspondante |
|
331 |
Grid4.Children.Add(Screen); |
|
332 |
||
333 |
Screen.UC_Screen_NewSession += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown); |
|
334 |
} |
|
131 | 335 |
else //Affichage du message de confirmation |
336 |
{ |
|
132 | 337 |
if (Panel4 != null && Grid4.Children.Count == 2) |
338 |
{ |
|
339 |
UserControlClose UCclose = new UserControlClose(4); |
|
340 |
UCclose.Name = "CloseAlert4"; |
|
341 |
Grid4.Children.Add(UCclose); |
|
342 |
UCclose.EH_SurfaceButtonClose_ContactDown += new EventHandler(CloseAlert_EH_SurfaceButton_ContactDown); |
|
343 |
} |
|
131 | 344 |
} |
112 | 345 |
break; |
346 |
} |
|
347 |
|
|
73 | 348 |
} |
72
f1ca0958c992
Travail sur le control List Video et comunication entre ListVideo et FingersDance
sarias
parents:
60
diff
changeset
|
349 |
|
73 | 350 |
//Button Submit du control SessionInput |
351 |
private void SessionInput_EH_SurfaceButtonSubmit_ContactDown(object sender, EventArgs e) |
|
352 |
{ |
|
353 |
try |
|
354 |
{ |
|
112 | 355 |
//1-Suppression du UC Screen |
104 | 356 |
Grid root = (Grid)(((UserControlScreen)sender).Parent); |
357 |
root.Children.Remove(((UserControlScreen)sender)); |
|
112 | 358 |
//2-Creation du User Panel |
359 |
switch (((UserControlScreen)sender).id) |
|
360 |
{ |
|
361 |
case 1: |
|
119 | 362 |
Panel1 = new UserControlUserPanel(((UserControlScreen)sender).Path); |
112 | 363 |
Panel1.Name = "UserPanel1"; |
364 |
//3-Rajout sur la Grid Root |
|
365 |
root.Children.Add(Panel1); |
|
366 |
break; |
|
367 |
case 2: |
|
119 | 368 |
Panel2 = new UserControlUserPanel(((UserControlScreen)sender).Path); |
112 | 369 |
Panel2.Name = "UserPanel2"; |
370 |
//3-Rajout sur la Grid Root |
|
371 |
root.Children.Add(Panel2); |
|
372 |
break; |
|
373 |
case 3: |
|
119 | 374 |
Panel3 = new UserControlUserPanel(((UserControlScreen)sender).Path); |
112 | 375 |
Panel3.Name = "UserPanel3"; |
376 |
//3-Rajout sur la Grid Root |
|
377 |
root.Children.Add(Panel3); |
|
378 |
break; |
|
379 |
case 4: |
|
119 | 380 |
Panel4 = new UserControlUserPanel(((UserControlScreen)sender).Path); |
112 | 381 |
Panel4.Name = "UserPanel4"; |
382 |
//3-Rajout sur la Grid Root |
|
383 |
root.Children.Add(Panel4); |
|
384 |
break; |
|
385 |
} |
|
73 | 386 |
} |
387 |
catch (Exception ex) { } |
|
72
f1ca0958c992
Travail sur le control List Video et comunication entre ListVideo et FingersDance
sarias
parents:
60
diff
changeset
|
388 |
} |
73 | 389 |
|
131 | 390 |
//Actions du boutton Alert selon l'action close OK ou NON |
391 |
private void CloseAlert_EH_SurfaceButton_ContactDown(object sender, EventArgs e) |
|
392 |
{ |
|
393 |
Grid root = (Grid)(((UserControlClose)sender).Parent); |
|
394 |
if(((UserControlClose) sender).close) |
|
395 |
{ |
|
396 |
switch(((UserControlClose)sender).Id) |
|
397 |
{ |
|
398 |
case 1: |
|
399 |
root.Children.Remove(Panel1); |
|
132 | 400 |
Panel1 = null; |
131 | 401 |
break; |
402 |
case 2: |
|
403 |
root.Children.Remove(Panel2); |
|
132 | 404 |
Panel2 = null; |
131 | 405 |
break; |
406 |
case 3: |
|
407 |
root.Children.Remove(Panel3); |
|
132 | 408 |
Panel3 = null; |
131 | 409 |
break; |
410 |
case 4: |
|
411 |
root.Children.Remove(Panel4); |
|
132 | 412 |
Panel4 = null; |
131 | 413 |
break; |
414 |
} |
|
415 |
} |
|
416 |
root.Children.Remove(((UserControlClose)sender)); |
|
417 |
} |
|
77 | 418 |
|
45 | 419 |
} |
420 |
} |