src/FingersDance.Control.Menu/UserControlMenu.xaml.cs
changeset 214 beebae32b1ed
parent 211 50e6fe2c2ea2
equal deleted inserted replaced
213:110067a19ec8 214:beebae32b1ed
   114          void ActionButton_ContactDown(object sender, RoutedEventArgs e)
   114          void ActionButton_ContactDown(object sender, RoutedEventArgs e)
   115          {
   115          {
   116              // Generate action
   116              // Generate action
   117              // We get the instance of the user panel
   117              // We get the instance of the user panel
   118              UserControl userPanel = (UserControl)((Grid)((Grid)this.Parent).Parent).Parent;
   118              UserControl userPanel = (UserControl)((Grid)((Grid)this.Parent).Parent).Parent;
   119              // Its content...
       
   120              Grid o = (Grid)userPanel.Content;
       
   121              // and the UserControlSyncSource within the grid...
       
   122              UserControlSyncSource syncSrc = (UserControlSyncSource)((Grid)o.Children[1]).Children[0];
       
   123              // and finally the timeline
       
   124              UserControlTimeLine tl = syncSrc.userControlTimeLine;
       
   125 
   119 
   126              String actionId = ((CustomSurfaceButton)sender).Action;
   120              String actionId = ((CustomSurfaceButton)sender).Action;
   127              ActionGenerator ag = new ActionGenerator();
   121              ActionGenerator ag = new ActionGenerator();
   128              Object[] ar = new Object[2];
   122              Object[] ar = new Object[2];
   129              ar[0] = tl;
   123              ar[0] = userPanel;
   130              ar[1] = (String)((CustomSurfaceButton)sender).Content;
   124              ar[1] = (String)((CustomSurfaceButton)sender).Content;
   131              ActionBase ab = ag.GetAction(actionId, ar);
   125              ActionBase ab = ag.GetAction(actionId, ar);
   132              if(ab!=null)
   126              if(ab!=null)
   133                  ab.Execute();
   127                  ab.Execute();
   134          }
   128          }