src/FingersDance.Control.Menu/UserControlMenu.xaml.cs
changeset 81 6b991b7e8046
parent 75 99d003723474
child 95 07972aa3f2e0
equal deleted inserted replaced
80:605e2e2e053f 81:6b991b7e8046
    64                  ItemButton.Style = (Style)FindResource(item.Ressource);
    64                  ItemButton.Style = (Style)FindResource(item.Ressource);
    65                  if (item.Items.Count > 0)
    65                  if (item.Items.Count > 0)
    66                  {
    66                  {
    67                      ItemButton.ContactDown += ButtonMenu_ContactDown;
    67                      ItemButton.ContactDown += ButtonMenu_ContactDown;
    68                      ItemButton.Click += ButtonMenu_ContactDown;
    68                      ItemButton.Click += ButtonMenu_ContactDown;
       
    69                      ItemButton.ContactHoldGesture += new ContactEventHandler(ItemButton_ContactHoldGesture);
    69                      MItem.Children.Add(ItemButton);
    70                      MItem.Children.Add(ItemButton);
    70                      StackPanel Temp = new StackPanel();
    71                      StackPanel Temp = new StackPanel();
    71                      foreach (Item elt in item.Items)
    72                      foreach (Item elt in item.Items)
    72                          try
    73                          try
    73                          {
    74                          {
    91              {
    92              {
    92                  throw ex;
    93                  throw ex;
    93              }
    94              }
    94          }
    95          }
    95 
    96 
       
    97          void ItemButton_ContactHoldGesture(object sender, ContactEventArgs e)
       
    98          {
       
    99              MessageBox.Show(((CustomSurfaceButton)sender).Action);
       
   100          }
       
   101 
    96          void ActionButton_ContactDown(object sender, RoutedEventArgs e)
   102          void ActionButton_ContactDown(object sender, RoutedEventArgs e)
    97          {
   103          {
    98              // Generate action
   104              // Generate action
    99              // We get the instance of the user panel
   105              // We get the instance of the user panel
   100              UserControl userPanel = (UserControl)((Grid)((Grid)this.Parent).Parent).Parent;
   106              UserControl userPanel = (UserControl)((Grid)((Grid)this.Parent).Parent).Parent;
   133                  }
   139                  }
   134                  catch (Exception ex) { }
   140                  catch (Exception ex) { }
   135              }
   141              }
   136          }
   142          }
   137 
   143 
       
   144          private void LayoutRoot_DragLeave(object sender, System.Windows.DragEventArgs e)
       
   145          {
       
   146              MessageBox.Show(((CustomSurfaceButton)sender).Action);
       
   147          }
       
   148 
   138         #region Events
   149         #region Events
   139 
   150 
   140      /*    
   151      /*    
   141         //Annotation
   152         //Annotation
   142         private void ButtonAnnotation_Click(object sender, RoutedEventArgs e)
   153         private void ButtonAnnotation_Click(object sender, RoutedEventArgs e)