src/FingersDance.Control.Player/UserControlPlayer.xaml.cs
changeset 197 3455e574e096
parent 195 48b3139bb182
child 199 70e93b0bd778
equal deleted inserted replaced
196:e738cd9c1b99 197:3455e574e096
   388 
   388 
   389         public void ApplyColor(List<Color> colors)
   389         public void ApplyColor(List<Color> colors)
   390         {
   390         {
   391             try
   391             try
   392             {
   392             {
       
   393                 Object o = null;
       
   394                 rect1.Fill = new SolidColorBrush(Colors.Black);
       
   395                 o = rect1.FindResource("Rect1Annotation");
       
   396                 rect1.BeginStoryboard((Storyboard)o);
       
   397                 rect2.Fill = new SolidColorBrush(Colors.Black);
       
   398                 o = rect2.FindResource("Rect2Annotation");
       
   399                 rect2.BeginStoryboard((Storyboard)o);
       
   400                 rect3.Fill = new SolidColorBrush(Colors.Black);
       
   401                 o = rect3.FindResource("Rect3Annotation");
       
   402                 rect3.BeginStoryboard((Storyboard)o);
       
   403                 rect4.Fill = new SolidColorBrush(Colors.Black);
       
   404                 o = rect4.FindResource("Rect4Annotation");
       
   405                 rect4.BeginStoryboard((Storyboard)o);
   393                 for (int i = 1; i <= colors.Count; i++)
   406                 for (int i = 1; i <= colors.Count; i++)
   394                     displayStackPanelAnnotations(i, new SolidColorBrush(colors[i - 1]));
   407                     displayStackPanelAnnotations(i, new SolidColorBrush(colors[i - 1]));
   395             }
   408             }
   396             catch { }
   409             catch { }
   397         }
   410         }
   398 
   411 
   399         //This function Sets a brush in a specific rectangle of the StackPanelAnnotation
   412         //This function Sets a brush in a specific rectangle of the StackPanelAnnotation
   400         public void displayStackPanelAnnotations(int id, Brush brushAnnotation)
   413         public void displayStackPanelAnnotations(int id, Brush brushAnnotation)
   401         {
   414         {
   402             rect1.Fill = new SolidColorBrush(Colors.Black);
   415             Object o = null;
   403             rect2.Fill = new SolidColorBrush(Colors.Black);
       
   404             rect3.Fill = new SolidColorBrush(Colors.Black);
       
   405             rect4.Fill = new SolidColorBrush(Colors.Black);
       
   406 
       
   407             switch (id)
   416             switch (id)
   408             {
   417             {
   409                 case 1: 
   418                 case 1: 
   410                     rect1.Fill = brushAnnotation;
   419                     rect1.Fill = brushAnnotation;
       
   420                     o = rect1.FindResource("Rect1Annotation");
       
   421                     rect1.BeginStoryboard((Storyboard)o);
   411                     break;
   422                     break;
   412                 case 2: 
   423                 case 2: rect2.Fill = brushAnnotation;
   413                     rect2.Fill = brushAnnotation;
   424                     o = rect2.FindResource("Rect2Annotation");
       
   425                     rect2.BeginStoryboard((Storyboard)o);
   414                     break;
   426                     break;
   415                 case 3: 
   427                 case 3: rect3.Fill = brushAnnotation;
   416                     rect3.Fill = brushAnnotation;
   428                     o = rect3.FindResource("Rect3Annotation");
       
   429                     rect3.BeginStoryboard((Storyboard)o);
   417                     break;
   430                     break;
   418                 case 4: 
   431                 case 4: rect4.Fill = brushAnnotation;
   419                     rect4.Fill = brushAnnotation;
   432                     o = rect4.FindResource("Rect4Annotation");
       
   433                     rect4.BeginStoryboard((Storyboard)o);
   420                     break;
   434                     break;
   421                 default: break;
   435                 default: break;
   422             }
   436             }
   423         }
   437         }
   424 	}
   438 	}