--- a/src/FingersDance.Control.Menu/UserControlMenu.xaml.cs Tue Sep 15 22:34:02 2009 +0200
+++ b/src/FingersDance.Control.Menu/UserControlMenu.xaml.cs Tue Sep 15 23:13:15 2009 +0200
@@ -63,23 +63,19 @@
ItemButton.Click += ButtonMenu_ContactDown;
MItem.Children.Add(ItemButton);
StackPanel Temp = new StackPanel();
- Temp.Margin = new Thickness(15,0,0,0);
foreach (Item elt in item.Items)
try
{
Temp.Children.Add(CreateMenuItem(elt));
}
catch (Exception) { }
- Temp.Name = ItemButton.Content + "Panel";
+ Temp.Name = ItemButton.Content.ToString().Replace(' ', '_') + "Panel";
Temp.Visibility = Visibility.Collapsed;
MItem.Children.Add(Temp);
}
else
{
ItemButton.Action = item.Action;
- //ItemButton.ApplyTemplate();
- //ItemButton.ContactDown += GenerateAction;
- //ItemButton.Click += GenerateAction;
MItem.Children.Add(ItemButton);
}
return MItem;
@@ -89,34 +85,13 @@
throw ex;
}
}
-
- /*
- * Déplacé dans le CustomSurfaceButton
-
- private void GenerateAction(Object sender, RoutedEventArgs Event)
- {
- try
- {
- ActionFactory.ActionGenerator AG = (new ActionFactory.ActionFactory()).GetGenerator();
- FingersDance.Actions.ActionBase action = AG.GetAction("Action" + ((Microsoft.Surface.Presentation.Controls.SurfaceButton)sender).Content, null);
- if (action != null)
- {
- //action.Execute();
- //this.debug.addToList(action.GetType().ToString());
- }
- }
- catch (Exception e) { }
- }
-
- *
- */
private void ButtonMenu_ContactDown(object sender, RoutedEventArgs e)
{
foreach (UIElement Child in ((Panel)((CustomSurfaceButton)sender).Parent).Children)
try
{
- if (((StackPanel)Child).Name.Equals(((Microsoft.Surface.Presentation.Controls.SurfaceButton)sender).Content + "Panel"))
+ if (((StackPanel)Child).Name.Equals(((Microsoft.Surface.Presentation.Controls.SurfaceButton)sender).Content.ToString().Replace(' ', '_') + "Panel"))
{
if (((StackPanel)Child).Visibility == Visibility.Collapsed)
{