author | cavaliet |
Wed, 25 Nov 2009 10:49:44 +0100 | |
changeset 231 | 4eff6b0c9215 |
parent 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 |
||
208
0699cab5cbb3
first step of search mode : add choice panel and integrate the annotation mode.
cavaliet
parents:
192
diff
changeset
|
28 |
public UserControlListProject(List<String> projectNames, String AnnotationOrSearchMode) |
147 | 29 |
{ |
30 |
InitializeComponent(); |
|
208
0699cab5cbb3
first step of search mode : add choice panel and integrate the annotation mode.
cavaliet
parents:
192
diff
changeset
|
31 |
OpenProjects(projectNames, AnnotationOrSearchMode); |
147 | 32 |
} |
33 |
||
208
0699cab5cbb3
first step of search mode : add choice panel and integrate the annotation mode.
cavaliet
parents:
192
diff
changeset
|
34 |
private void OpenProjects(List<String> projectNames, String AnnotationOrSearchMode) |
147 | 35 |
{ |
208
0699cab5cbb3
first step of search mode : add choice panel and integrate the annotation mode.
cavaliet
parents:
192
diff
changeset
|
36 |
// We add the "new project" item only if we are in "Annotation" mode. Search mode only needs existing projects |
0699cab5cbb3
first step of search mode : add choice panel and integrate the annotation mode.
cavaliet
parents:
192
diff
changeset
|
37 |
if (AnnotationOrSearchMode == "Annotation") |
0699cab5cbb3
first step of search mode : add choice panel and integrate the annotation mode.
cavaliet
parents:
192
diff
changeset
|
38 |
{ |
0699cab5cbb3
first step of search mode : add choice panel and integrate the annotation mode.
cavaliet
parents:
192
diff
changeset
|
39 |
CustomListBoxItem Contener = new CustomListBoxItem(); |
0699cab5cbb3
first step of search mode : add choice panel and integrate the annotation mode.
cavaliet
parents:
192
diff
changeset
|
40 |
Contener.Name = "New Project"; |
0699cab5cbb3
first step of search mode : add choice panel and integrate the annotation mode.
cavaliet
parents:
192
diff
changeset
|
41 |
UserControlCustomLabel l = new UserControlCustomLabel("New Project"); |
0699cab5cbb3
first step of search mode : add choice panel and integrate the annotation mode.
cavaliet
parents:
192
diff
changeset
|
42 |
Contener.Content = l; |
0699cab5cbb3
first step of search mode : add choice panel and integrate the annotation mode.
cavaliet
parents:
192
diff
changeset
|
43 |
stackPanel.Children.Add(Contener); |
0699cab5cbb3
first step of search mode : add choice panel and integrate the annotation mode.
cavaliet
parents:
192
diff
changeset
|
44 |
Contener.ContactTapGesture += Item_ContactTapGesture; |
0699cab5cbb3
first step of search mode : add choice panel and integrate the annotation mode.
cavaliet
parents:
192
diff
changeset
|
45 |
} |
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
|
46 |
foreach (String projectName in projectNames) |
147 | 47 |
{ |
208
0699cab5cbb3
first step of search mode : add choice panel and integrate the annotation mode.
cavaliet
parents:
192
diff
changeset
|
48 |
CustomListBoxItem 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
|
49 |
Contener.Name = projectName; |
208
0699cab5cbb3
first step of search mode : add choice panel and integrate the annotation mode.
cavaliet
parents:
192
diff
changeset
|
50 |
UserControlCustomLabel l = new UserControlCustomLabel(projectName); |
147 | 51 |
Contener.Content = l; |
52 |
stackPanel.Children.Add(Contener); |
|
53 |
Contener.ContactTapGesture += Item_ContactTapGesture; |
|
54 |
} |
|
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; |
|
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
|
61 |
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
|
62 |
EH_ListProject_ContactDown(this, new EventArgs()); |
147 | 63 |
} |
64 |
} |
|
65 |
} |