diff -r 68f4c0d7a7fc -r 6a738974dd2e src/FingersDance/MainSurfaceWindow.xaml.cs --- a/src/FingersDance/MainSurfaceWindow.xaml.cs Wed Sep 23 17:24:33 2009 +0200 +++ b/src/FingersDance/MainSurfaceWindow.xaml.cs Wed Sep 23 17:48:18 2009 +0200 @@ -18,6 +18,8 @@ using FingersDance.Control.UserPanel; using FingersDance.Control.ListVideo; using FingersDance.Control.SessionInput; +using FingersDance.Control.Screen; + namespace FingersDance { @@ -194,19 +196,24 @@ if (!isCreatedP1) { + //1-Creation du control Screen + UserControlScreen Screen1 = new UserControlScreen(); + Screen1.Name = "Screen1"; + Screen1.contexteGrid = Grid1.Name.ToString(); + //2-Rajout du screen dans la grid correspondante + Grid1.Children.Add(Screen1); + + //3-Creation de la ListVideo UserControlListVideo ListVideo1 = new UserControlListVideo(); ListVideo1.Name = "ListVideo1"; - Grid1.Children.Add(ListVideo1); + //4-Ajout de la ListVideo au ControlScreen + Screen1.AddToGrid(ListVideo1); - //Creation des Events pour chaque item de la video + //5-Creation des Events pour chaque item de la video ListVideo1.EH_ItemVideo1_ContactDown += new System.EventHandler(this.ListVideo1_EH_ItemVideo1_ContactDown); ListVideo1.EH_ItemVideo2_ContactDown += new System.EventHandler(this.ListVideo1_EH_ItemVideo2_ContactDown); - /* - UserControlUserPanel UserPanel1 = new UserControlUserPanel(); - UserPanel1.Name = "UserPanel1"; - Grid1.Children.Add(UserPanel1); - isCreatedP1 = true;*/ + } } @@ -251,18 +258,21 @@ //scatterViewItemSessionInput.Name = "ScatterViewItemSessionInput"; - //Creation d'une nouvelle seance. - + //1-Creation d'une nouvelle seance. UserControlSessionInput SessionInput = new UserControlSessionInput(); SessionInput.Name = "SessionInput"; try{ + //2-Recuperer la Grid qui contient le UCListVideo et l'ajouter. Grid actualGrid = (Grid)(((UserControlListVideo)sender).Parent); actualGrid.Children.Add(SessionInput); + //3-Creation des Events SessionInput.EH_SurfaceButtonSubmit_ContactDown += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown); + //4-Supression du UC List Video actualGrid.Children.Remove((UserControlListVideo)sender); + //Init Scatter View Properties and Add it to the scatter view. /*scatterViewItemSessionInput.Content = SessionInput; scatterViewItemSessionInput.CanMove = true; @@ -285,12 +295,18 @@ { try { + //1-Recuperation de actualGrid (LayoutRoot du UC Screen) Grid actualGrid = (Grid)(((UserControlSessionInput)sender).Parent); + //2-Suppression UCSession Input actualGrid.Children.Remove((UserControlSessionInput)sender); - //Creation du User Panel + //3-Suppression du UC Screen + Grid root = (Grid) ((UserControlScreen)actualGrid.Parent).Parent; + root.Children.Remove((UserControlScreen)actualGrid.Parent); + //4-Creation du User Panel UserControlUserPanel UserPanel1 = new UserControlUserPanel(); UserPanel1.Name = "UserPanel1"; - actualGrid.Children.Add(UserPanel1); + //5-Rajout sur la Grid Root + root.Children.Add(UserPanel1); } catch (Exception ex) { }