|
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 UserControlListCutting.xaml |
|
21 /// </summary> |
|
22 public partial class UserControlListCutting : UserControl |
|
23 { |
|
24 //Creation d'un Event pour Chaque Item Video |
|
25 public event EventHandler EH_Item_ContactDown; |
|
26 public string SelectedItem = ""; |
|
27 |
|
28 public UserControlListCutting(Dictionary<string, Cutting> cuttings) |
|
29 { |
|
30 InitializeComponent(); |
|
31 OpenSessions(cuttings); |
|
32 } |
|
33 |
|
34 private void OpenSessions(Dictionary<string, Cutting> cuttings) |
|
35 { |
|
36 try |
|
37 { |
|
38 CustomListBoxItem Contener = new CustomListBoxItem(); |
|
39 Contener.Name = "New Cutting"; |
|
40 UserControlCustomLabel l = new UserControlCustomLabel("New Cutting"); |
|
41 Contener.Content = l; |
|
42 stackPanel.Children.Add(Contener); |
|
43 Contener.ContactTapGesture += Item_ContactTapGesture; |
|
44 foreach (KeyValuePair<string, Cutting> elt in cuttings) |
|
45 { |
|
46 Contener = new CustomListBoxItem(); |
|
47 Contener.Name = elt.Key; |
|
48 l = new UserControlCustomLabel(elt.Key); |
|
49 Contener.Content = l; |
|
50 stackPanel.Children.Add(Contener); |
|
51 Contener.ContactTapGesture += Item_ContactTapGesture; |
|
52 } |
|
53 } |
|
54 catch (Exception) { } |
|
55 } |
|
56 |
|
57 //Event appelé lors de la selection d'un Item dans la Liste |
|
58 private void Item_ContactTapGesture(object sender, Microsoft.Surface.Presentation.ContactEventArgs e) |
|
59 { |
|
60 SelectedItem = ((CustomListBoxItem)sender).Name; |
|
61 if (EH_Item_ContactDown != null) |
|
62 EH_Item_ContactDown(this, new EventArgs()); |
|
63 } |
|
64 |
|
65 |
|
66 } |
|
67 } |