src/FingersDance/MainSurfaceWindow.xaml.cs
changeset 156 e16c8c913c65
parent 152 46577fd0a294
child 160 e940ca798fe3
--- a/src/FingersDance/MainSurfaceWindow.xaml.cs	Fri Oct 16 02:35:11 2009 +0200
+++ b/src/FingersDance/MainSurfaceWindow.xaml.cs	Fri Oct 16 03:37:48 2009 +0200
@@ -20,7 +20,7 @@
 using FingersDance.Control.Close;
 using FingersDance.ViewModels;
 using FingersDance.Data;
-
+using FingersDance.Factory;
 
 namespace FingersDance
 {
@@ -39,7 +39,7 @@
         private UserControlUserPanel Panel2 = null;
         private UserControlUserPanel Panel3 = null;
         private UserControlUserPanel Panel4 = null;
-        ActionFactory.ActionGenerator _Factory = new FingersDance.ActionFactory.ActionFactory().GetGenerator();
+        ActionGenerator _Factory = (new ActionFactory()).GetGenerator();
         private MainViewModel _mainviewmodel = new MainViewModel();      
 
         #endregion
@@ -407,27 +407,33 @@
                     if ((Panel1 != null && Panel1.Project.Equals(newProject)) || (Panel2 != null && Panel2.Project.Equals(newProject)) || (Panel3 != null && Panel3.Project.Equals(newProject)) || (Panel4 != null && Panel4.Project.Equals(newProject)))
                         return;
 
+                    Random c = new Random();
+                    int color = c.Next(12);
                     switch (((UserControlScreen)sender).id)
                     {
                         case 1:
+                            UserControlPivot.ApplyColor(1, "Color_" + color);
                             Panel1 = new UserControlUserPanel(1, 0xFF5A0FC8, newProject, _mainviewmodel.Session.VideoPath);
                             Panel1.Name = "UserPanel1";
                             //3-Rajout sur la Grid Root
                             root.Children.Add(Panel1);
                             break;
                         case 2:
+                            UserControlPivot.ApplyColor(2, "Color_" + color);
                             Panel2 = new UserControlUserPanel(2, 0xFFC80FA0, newProject, _mainviewmodel.Session.VideoPath);
                             Panel2.Name = "UserPanel2";
                             //3-Rajout sur la Grid Root
                             root.Children.Add(Panel2);
                             break;
                         case 3:
+                            UserControlPivot.ApplyColor(3, "Color_" + color);
                             Panel3 = new UserControlUserPanel(3, 0xFFFFFF00, newProject, _mainviewmodel.Session.VideoPath);
                             Panel3.Name = "UserPanel3";
                             //3-Rajout sur la Grid Root
                             root.Children.Add(Panel3);
                             break;
                         case 4:
+                            UserControlPivot.ApplyColor(4, "Color_" + color);
                             Panel4 = new UserControlUserPanel(4, 0xFF0096FF, newProject, _mainviewmodel.Session.VideoPath);
                             Panel4.Name = "UserPanel4";
                             //3-Rajout sur la Grid Root
@@ -448,18 +454,22 @@
                 switch(e.PanelNumber)
                 {
                     case 1:
+                        UserControlPivot.ApplyColor(1, "Default");
                         root.Children.Remove(Panel1);
                         Panel1 = null;
                         break;
                     case 2:
+                        UserControlPivot.ApplyColor(2, "Default");
                         root.Children.Remove(Panel2);
                         Panel2 = null;
                         break;
                     case 3:
+                        UserControlPivot.ApplyColor(3, "Default");
                         root.Children.Remove(Panel3);
                         Panel3 = null;
                         break;
                     case 4:
+                        UserControlPivot.ApplyColor(4, "Default");
                         root.Children.Remove(Panel4);
                         Panel4 = null;
                         break;