# HG changeset patch # User PAMPHILE Jonathan # Date 1253700083 -7200 # Node ID 6b991b7e80469a8c72e375652bfbad7fe32d1cb2 # Parent 605e2e2e053fd5a30f2a419822dd4cbeafda4cc4 Custom Surface Button diff -r 605e2e2e053f -r 6b991b7e8046 src/FingersDance.Control.Menu/CustomSurfaceButton.cs --- a/src/FingersDance.Control.Menu/CustomSurfaceButton.cs Wed Sep 23 09:59:30 2009 +0200 +++ b/src/FingersDance.Control.Menu/CustomSurfaceButton.cs Wed Sep 23 12:01:23 2009 +0200 @@ -26,24 +26,6 @@ } public CustomSurfaceButton() - { - this.ContactDown += GenerateAction; - this.Click += GenerateAction; - } - - private void GenerateAction(Object sender, EventArgs Event) - { - try - { - ActionFactory.ActionGenerator AG = (new ActionFactory.ActionFactory()).GetGenerator(); - FingersDance.Actions.ActionBase action = AG.GetAction("Action" + ((CustomSurfaceButton)sender).Content, null); - if (action != null) - { - //action.Execute(); - //this.debug.addToList(action.GetType().ToString()); - } - } - catch (Exception e) { } - } + { } } } diff -r 605e2e2e053f -r 6b991b7e8046 src/FingersDance.Control.Menu/UserControlMenu.xaml --- a/src/FingersDance.Control.Menu/UserControlMenu.xaml Wed Sep 23 09:59:30 2009 +0200 +++ b/src/FingersDance.Control.Menu/UserControlMenu.xaml Wed Sep 23 12:01:23 2009 +0200 @@ -468,7 +468,5 @@ - - - + \ No newline at end of file diff -r 605e2e2e053f -r 6b991b7e8046 src/FingersDance.Control.Menu/UserControlMenu.xaml.cs --- a/src/FingersDance.Control.Menu/UserControlMenu.xaml.cs Wed Sep 23 09:59:30 2009 +0200 +++ b/src/FingersDance.Control.Menu/UserControlMenu.xaml.cs Wed Sep 23 12:01:23 2009 +0200 @@ -66,6 +66,7 @@ { ItemButton.ContactDown += ButtonMenu_ContactDown; ItemButton.Click += ButtonMenu_ContactDown; + ItemButton.ContactHoldGesture += new ContactEventHandler(ItemButton_ContactHoldGesture); MItem.Children.Add(ItemButton); StackPanel Temp = new StackPanel(); foreach (Item elt in item.Items) @@ -93,6 +94,11 @@ } } + void ItemButton_ContactHoldGesture(object sender, ContactEventArgs e) + { + MessageBox.Show(((CustomSurfaceButton)sender).Action); + } + void ActionButton_ContactDown(object sender, RoutedEventArgs e) { // Generate action @@ -135,6 +141,11 @@ } } + private void LayoutRoot_DragLeave(object sender, System.Windows.DragEventArgs e) + { + MessageBox.Show(((CustomSurfaceButton)sender).Action); + } + #region Events /*