client/test/mainInterface/Iri.Modernisation.Test.MainInterface/MainPage.xaml.cs
changeset 27 f292db96b050
parent 18 66911d0f0eb6
child 30 644e3cd48034
equal deleted inserted replaced
26:44a2dc869e28 27:f292db96b050
    18 namespace Iri.Modernisation.Test.MainInterface
    18 namespace Iri.Modernisation.Test.MainInterface
    19 {
    19 {
    20     public partial class MainPage : UserControl
    20     public partial class MainPage : UserControl
    21     {
    21     {
    22         public MainPage()
    22         public MainPage()
    23         {
    23         {    Commands.Initialize();
    24             Commands.Initialize();
    24             FactoryVideoLivre.Initialize();
    25             InitializeComponent();
    25             //FactoryVideoLivre.xmlClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(xmlClient_DownloadStringCompleted);
    26            List<VideoBook> SelectedVideoBooks = new List<VideoBook>();
    26             FactoryVideoLivre.Load("ProjectConfig.xml");
       
    27             List<VideoBook> SelectedVideoBooks = new List<VideoBook>();
    27             /*************** Content Demo ***************/
    28             /*************** Content Demo ***************/
    28            /* Pour pouvoir tester avec des vidéos :     
    29             /* Pour pouvoir tester avec des vidéos :     
    29             * - Placer les video dans le dossier Bin
    30              * - Placer les video dans le dossier Bin
    30             * - Rajouter Application.Current.Host.Source.Host devant le nom du fichier
    31              * - Rajouter Application.Current.Host.Source.Host devant le nom du fichier
    31             */
    32              */
    32            LDTFile file = new LDTFile();
    33             LDTFile file = new LDTFile();
    33             // file.Load(new Uri("Modernisation.FileConvertor;component/ENMI08-I-bernard_stiegler-jauffret.ldt", UriKind.Relative).ToString());
    34             // file.Load(new Uri("Modernisation.FileConvertor;component/ENMI08-I-bernard_stiegler-jauffret.ldt", UriKind.Relative).ToString());
    34             file.Load("Content/ENMI08-I-bernard_stiegler-jauffret.ldt");
    35             file.Load("Content/ENMI08-I-bernard_stiegler-jauffret.ldt");
    35             
    36 
    36             LDTFileReader _LDTFR = new LDTFileReader("Content/ENMI08-I-bernard_stiegler-jauffret.ldt");
    37             LDTFileReader _LDTFR = new LDTFileReader("Content/ENMI08-I-bernard_stiegler-jauffret.ldt");
    37             VideoBook temp = _LDTFR.VideoBook;
    38             VideoBook temp = _LDTFR.VideoBook;
    38             temp.Chapters[0].VideoSequences = new List<VideoSequence>();
    39             temp.Chapters[0].VideoSequences = new List<VideoSequence>();
    39             temp.Chapters[0].VideoSequences.Add(new VideoSequence());
    40             temp.Chapters[0].VideoSequences.Add(new VideoSequence());
    40             temp.MediaPath = Application.Current.Host.Source.Host+@"/test.wmv";
    41             temp.MediaPath = Application.Current.Host.Source.Host + @"/test.wmv";
    41             SelectedVideoBooks.Add(temp);
    42             SelectedVideoBooks.Add(temp);
    42             temp = new LDTFileReader("Content/ENMI08-II-antoine_masson-jauffret.ldt").VideoBook;
    43             temp = new LDTFileReader("Content/ENMI08-II-antoine_masson-jauffret.ldt").VideoBook;
    43            
    44 
    44             temp.MediaPath = Application.Current.Host.Source.Host+@"/video.mp4";
    45             temp.MediaPath = Application.Current.Host.Source.Host + @"/video.mp4";
    45             SelectedVideoBooks.Add(temp);
    46             SelectedVideoBooks.Add(temp);
    46             SelectedVideoBooks.Add(new LDTFileReader("Content/ENMI08-III_elizabethrosse-psychologie_et_reseaux_sociaux-jauffret.ldt").VideoBook);
    47             SelectedVideoBooks.Add(new LDTFileReader("Content/ENMI08-III_elizabethrosse-psychologie_et_reseaux_sociaux-jauffret.ldt").VideoBook);
    47            // SelectedVideoBooks.Add(new LDTFileReader("Content/ENMI08-IV-dominiquepasquier-jauffret.ldt").VideoBook);
    48             // SelectedVideoBooks.Add(new LDTFileReader("Content/ENMI08-IV-dominiquepasquier-jauffret.ldt").VideoBook);
    48             /********************************************/
    49             /********************************************/
    49 
    50 
    50             /*************** Initialisation des commandes ***************/
    51             /*************** Initialisation des commandes ***************/
    51             
    52             InitializeComponent();
    52             // Commands.FlipView.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(FlipView_Executed);
    53             // Commands.FlipView.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(FlipView_Executed);
    53             /********************************************/
    54             /********************************************/
    54             MainElement.DataContext = new MainVM(SelectedVideoBooks);
    55             MainElement.DataContext = new MainVM(SelectedVideoBooks);
    55             /*************** Initialisation des Component **************
    56             /*************** Initialisation des Component **************
    56             InitializeComponent();
    57             InitializeComponent();
    59             NavigationBarElement.DataContext = navvm;
    60             NavigationBarElement.DataContext = navvm;
    60             HeaderControlElement.DataContext = new HeaderControlVM("L'utilisateur");
    61             HeaderControlElement.DataContext = new HeaderControlVM("L'utilisateur");
    61             ProductionViewElement.DataContext = new HeaderProductionVM();
    62             ProductionViewElement.DataContext = new HeaderProductionVM();
    62             /********************************************/
    63             /********************************************/
    63            
    64            
       
    65 
       
    66             //èMainElement.DataContext = new MainVM(new List<VideoBook>());
       
    67 
    64         }
    68         }
       
    69 
       
    70         void xmlClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
       
    71         {
       
    72             if (e.Error == null)
       
    73             {
       
    74                 
       
    75               
       
    76             }
       
    77             else
       
    78             {
       
    79                 MessageBox.Show(e.Error.InnerException.Message);
       
    80             }
       
    81         }
       
    82            
       
    83            
       
    84         
    65 
    85 
    66        
    86        
    67     }
    87     }
    68     
    88     
    69 }
    89 }