src/FingersDance.Control.SessionInput/UserControlListProject.xaml.cs
author ARIAS Santiago
Sat, 14 Nov 2009 19:07:51 +0100
changeset 201 16287a7d1f1a
parent 192 11083c390ce4
child 208 0699cab5cbb3
permissions -rw-r--r--
Surface ScrollViewer for Control.Menu
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
147
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     1
using System;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     2
using System.Collections.Generic;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     3
using System.Linq;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     4
using System.Text;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     5
using System.Windows;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     6
using System.Windows.Controls;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     7
using System.Windows.Data;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     8
using System.Windows.Documents;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     9
using System.Windows.Input;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    10
using System.Windows.Media;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    11
using System.Windows.Media.Imaging;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    12
using System.Windows.Navigation;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    13
using System.Windows.Shapes;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    14
using FingersDance.Data;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    15
using FingersDance.Control;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    16
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    17
namespace FingersDance.Control.SessionInput
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    18
{
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    19
    /// <summary>
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    20
    /// Interaction logic for UserControlListProject.xaml
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    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
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    23
    {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    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
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    26
        public string SelectedItem = "";
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    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
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    29
        {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    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
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    32
        }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    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
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    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
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    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
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    47
                Contener.Content = l;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    48
                stackPanel.Children.Add(Contener);
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    49
                Contener.ContactTapGesture += Item_ContactTapGesture;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    50
            }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    51
        }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    52
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    53
        //Event appelé lors de la selection d'un Item dans la Liste
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    54
        private void Item_ContactTapGesture(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    55
        {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    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
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    59
        }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    60
    }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    61
}