--- a/src/FingersDance.Control.SessionInput/UserControlListProject.xaml.cs Wed Nov 04 16:28:01 2009 +0100
+++ b/src/FingersDance.Control.SessionInput/UserControlListProject.xaml.cs Thu Nov 05 13:13:52 2009 +0100
@@ -19,47 +19,43 @@
/// <summary>
/// Interaction logic for UserControlListProject.xaml
/// </summary>
- public partial class UserControlListProject
+ public partial class UserControlListProject : UserControl
{
//Creation d'un Event pour Chaque Item Video
- public event EventHandler EH_Item_ContactDown;
+ public event EventHandler EH_ListProject_ContactDown;
public string SelectedItem = "";
- public UserControlListProject(Dictionary<string, Cutting> cuttings)
+ public UserControlListProject(List<Project> projects)
{
InitializeComponent();
- OpenSessions(cuttings);
+ OpenProjects(projects);
}
- private void OpenSessions(Dictionary<string, Cutting> cuttings)
+ private void OpenProjects(List<Project> projects)
{
- try
+ CustomListBoxItem Contener = new CustomListBoxItem();
+ Contener.Name = "New Project";
+ UserControlCustomLabel l = new UserControlCustomLabel("New Project");
+ Contener.Content = l;
+ stackPanel.Children.Add(Contener);
+ Contener.ContactTapGesture += Item_ContactTapGesture;
+ foreach (Project elt in projects)
{
- CustomListBoxItem Contener = new CustomListBoxItem();
- Contener.Name = "New Cutting";
- UserControlCustomLabel l = new UserControlCustomLabel("New Cutting");
+ Contener = new CustomListBoxItem();
+ Contener.Name = elt.Name;
+ l = new UserControlCustomLabel(elt.Name);
Contener.Content = l;
stackPanel.Children.Add(Contener);
Contener.ContactTapGesture += Item_ContactTapGesture;
- foreach (KeyValuePair<string, Cutting> elt in cuttings)
- {
- Contener = new CustomListBoxItem();
- Contener.Name = elt.Key;
- l = new UserControlCustomLabel(elt.Key);
- Contener.Content = l;
- stackPanel.Children.Add(Contener);
- Contener.ContactTapGesture += Item_ContactTapGesture;
- }
}
- catch (Exception) { }
}
//Event appelé lors de la selection d'un Item dans la Liste
private void Item_ContactTapGesture(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
{
SelectedItem = ((CustomListBoxItem)sender).Name;
- if (EH_Item_ContactDown != null)
- EH_Item_ContactDown(this, new EventArgs());
+ if (EH_ListProject_ContactDown != null)
+ EH_ListProject_ContactDown(this, new EventArgs());
}
}
}