diff -r 0fd2b41ab402 -r e940ca798fe3 src/FingersDance/MainSurfaceWindow.xaml.cs --- a/src/FingersDance/MainSurfaceWindow.xaml.cs Fri Oct 16 09:02:04 2009 +0200 +++ b/src/FingersDance/MainSurfaceWindow.xaml.cs Fri Oct 16 15:56:09 2009 +0200 @@ -408,33 +408,33 @@ return; Random c = new Random(); - int color = c.Next(12); + uint color = (uint)c.Next(12) + 1; // for the number to be >0 switch (((UserControlScreen)sender).id) { case 1: - UserControlPivot.ApplyColor(1, "Color_" + color); - Panel1 = new UserControlUserPanel(1, 0xFF5A0FC8, newProject, _mainviewmodel.Session.VideoPath); + UserControlPivot.ApplyColor(1, color); + Panel1 = new UserControlUserPanel(1, (new ColorFactory()).Colors[color], 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); + UserControlPivot.ApplyColor(2, color); + Panel2 = new UserControlUserPanel(2, (new ColorFactory()).Colors[color], 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); + UserControlPivot.ApplyColor(3, color); + Panel3 = new UserControlUserPanel(3, (new ColorFactory()).Colors[color], 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); + UserControlPivot.ApplyColor(4, color); + Panel4 = new UserControlUserPanel(4, (new ColorFactory()).Colors[color], newProject, _mainviewmodel.Session.VideoPath); Panel4.Name = "UserPanel4"; //3-Rajout sur la Grid Root root.Children.Add(Panel4); @@ -454,22 +454,22 @@ switch(e.PanelNumber) { case 1: - UserControlPivot.ApplyColor(1, "Default"); + UserControlPivot.ApplyColor(1, 0); root.Children.Remove(Panel1); Panel1 = null; break; case 2: - UserControlPivot.ApplyColor(2, "Default"); + UserControlPivot.ApplyColor(2, 0); root.Children.Remove(Panel2); Panel2 = null; break; case 3: - UserControlPivot.ApplyColor(3, "Default"); + UserControlPivot.ApplyColor(3, 0); root.Children.Remove(Panel3); Panel3 = null; break; case 4: - UserControlPivot.ApplyColor(4, "Default"); + UserControlPivot.ApplyColor(4, 0); root.Children.Remove(Panel4); Panel4 = null; break;