author | sarias |
Thu, 15 Oct 2009 16:25:38 +0200 | |
changeset 153 | 3636bb5f4b67 |
parent 147 | 1a5da89daee9 |
child 182 | 25b49d4f1635 |
permissions | -rw-r--r-- |
147 | 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.Navigation; |
|
13 |
using System.Windows.Shapes; |
|
14 |
using FingersDance.Data; |
|
15 |
using FingersDance.Control; |
|
16 |
||
17 |
namespace FingersDance.Control.SessionInput |
|
18 |
{ |
|
19 |
/// <summary> |
|
20 |
/// Interaction logic for UserControlListSession.xaml |
|
21 |
/// </summary> |
|
22 |
public partial class UserControlListSession |
|
23 |
{ |
|
24 |
//Creation d'un Event pour Chaque Item Video |
|
25 |
public event EventHandler EH_List_ContactDown; |
|
26 |
public string SelectedItem = ""; |
|
27 |
||
28 |
public UserControlListSession(List<Session> sessions) |
|
29 |
{ |
|
30 |
InitializeComponent(); |
|
31 |
OpenSessions(sessions); |
|
32 |
} |
|
33 |
||
34 |
private void OpenSessions(List<Session> sessions) |
|
35 |
{ |
|
36 |
CustomListBoxItem Contener = new CustomListBoxItem(); |
|
37 |
Contener.Name = "New Session"; |
|
153
3636bb5f4b67
Custom Label and UserControl NewProject and SessionInput changes
sarias
parents:
147
diff
changeset
|
38 |
UserControlCustomLabel l = new UserControlCustomLabel("New Session"); |
147 | 39 |
Contener.Content = l; |
40 |
stackPanel.Children.Add(Contener); |
|
41 |
Contener.ContactTapGesture += Item_ContactTapGesture; |
|
42 |
foreach (Session elt in sessions) |
|
43 |
{ |
|
44 |
Contener = new CustomListBoxItem(); |
|
45 |
Contener.Name = elt.Name; |
|
153
3636bb5f4b67
Custom Label and UserControl NewProject and SessionInput changes
sarias
parents:
147
diff
changeset
|
46 |
l = new UserControlCustomLabel(elt.Name); |
147 | 47 |
Contener.Content = l; |
48 |
stackPanel.Children.Add(Contener); |
|
49 |
Contener.ContactTapGesture += Item_ContactTapGesture; |
|
50 |
} |
|
51 |
} |
|
52 |
||
53 |
//Event appelé lors de la selection d'un Item dans la Liste |
|
54 |
private void Item_ContactTapGesture(object sender, Microsoft.Surface.Presentation.ContactEventArgs e) |
|
55 |
{ |
|
56 |
SelectedItem = ((CustomListBoxItem)sender).Name; |
|
57 |
if (EH_List_ContactDown != null) |
|
58 |
EH_List_ContactDown(this, new EventArgs()); |
|
59 |
} |
|
60 |
} |
|
61 |
} |