author | ARIAS Santiago |
Sat, 14 Nov 2009 19:07:51 +0100 | |
changeset 201 | 16287a7d1f1a |
parent 192 | 11083c390ce4 |
child 208 | 0699cab5cbb3 |
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 UserControlListProject.xaml |
|
21 |
/// </summary> |
|
187
b266af50744c
Change file and event names for code to be clearer and more coherent with the project and cuttings organisation
cavaliet
parents:
182
diff
changeset
|
22 |
public partial class UserControlListProject : UserControl |
147 | 23 |
{ |
24 |
//Creation d'un Event pour Chaque Item Video |
|
187
b266af50744c
Change file and event names for code to be clearer and more coherent with the project and cuttings organisation
cavaliet
parents:
182
diff
changeset
|
25 |
public event EventHandler EH_ListProject_ContactDown; |
147 | 26 |
public string SelectedItem = ""; |
27 |
||
192
11083c390ce4
Second step of data saving : id added for cutting and annotation, and now we can load/display/change the already existing projects.
cavaliet
parents:
187
diff
changeset
|
28 |
public UserControlListProject(List<String> projectNames) |
147 | 29 |
{ |
30 |
InitializeComponent(); |
|
192
11083c390ce4
Second step of data saving : id added for cutting and annotation, and now we can load/display/change the already existing projects.
cavaliet
parents:
187
diff
changeset
|
31 |
OpenProjects(projectNames); |
147 | 32 |
} |
33 |
||
192
11083c390ce4
Second step of data saving : id added for cutting and annotation, and now we can load/display/change the already existing projects.
cavaliet
parents:
187
diff
changeset
|
34 |
private void OpenProjects(List<String> projectNames) |
147 | 35 |
{ |
187
b266af50744c
Change file and event names for code to be clearer and more coherent with the project and cuttings organisation
cavaliet
parents:
182
diff
changeset
|
36 |
CustomListBoxItem Contener = new CustomListBoxItem(); |
b266af50744c
Change file and event names for code to be clearer and more coherent with the project and cuttings organisation
cavaliet
parents:
182
diff
changeset
|
37 |
Contener.Name = "New Project"; |
b266af50744c
Change file and event names for code to be clearer and more coherent with the project and cuttings organisation
cavaliet
parents:
182
diff
changeset
|
38 |
UserControlCustomLabel l = new UserControlCustomLabel("New Project"); |
b266af50744c
Change file and event names for code to be clearer and more coherent with the project and cuttings organisation
cavaliet
parents:
182
diff
changeset
|
39 |
Contener.Content = l; |
b266af50744c
Change file and event names for code to be clearer and more coherent with the project and cuttings organisation
cavaliet
parents:
182
diff
changeset
|
40 |
stackPanel.Children.Add(Contener); |
b266af50744c
Change file and event names for code to be clearer and more coherent with the project and cuttings organisation
cavaliet
parents:
182
diff
changeset
|
41 |
Contener.ContactTapGesture += Item_ContactTapGesture; |
192
11083c390ce4
Second step of data saving : id added for cutting and annotation, and now we can load/display/change the already existing projects.
cavaliet
parents:
187
diff
changeset
|
42 |
foreach (String projectName in projectNames) |
147 | 43 |
{ |
187
b266af50744c
Change file and event names for code to be clearer and more coherent with the project and cuttings organisation
cavaliet
parents:
182
diff
changeset
|
44 |
Contener = new CustomListBoxItem(); |
192
11083c390ce4
Second step of data saving : id added for cutting and annotation, and now we can load/display/change the already existing projects.
cavaliet
parents:
187
diff
changeset
|
45 |
Contener.Name = projectName; |
11083c390ce4
Second step of data saving : id added for cutting and annotation, and now we can load/display/change the already existing projects.
cavaliet
parents:
187
diff
changeset
|
46 |
l = new UserControlCustomLabel(projectName); |
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; |
|
187
b266af50744c
Change file and event names for code to be clearer and more coherent with the project and cuttings organisation
cavaliet
parents:
182
diff
changeset
|
57 |
if (EH_ListProject_ContactDown != null) |
b266af50744c
Change file and event names for code to be clearer and more coherent with the project and cuttings organisation
cavaliet
parents:
182
diff
changeset
|
58 |
EH_ListProject_ContactDown(this, new EventArgs()); |
147 | 59 |
} |
60 |
} |
|
61 |
} |