0

In my app i want to be able to recognise certain gestures that occur on an ui element.

So far i have got this: (where main grid is the element)

mainGrid.ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.TranslateY;
mainGrid.ManipulationCompleted += OnManipulationCompleted;

public void OnManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
    var velocities = e.Velocities;
}

but i get certain weird errors

Error 1 No overload for 'OnManipulationCompleted' matches delegate 'Windows.UI.Xaml.Input.ManipulationCompletedEventHandler' C:\Visual Studio 2013\Projects\Swell\Swell\MainPage.xaml.cs

reference : Handling Swipe Guesture in Windows 8 Grid

Community
  • 1
  • 1
rsharma
  • 169
  • 1
  • 10

2 Answers2

0

OnManipulationCompleted is probably a method provided by your base class its signature does not match.

I suspect that you need to change the name to avoid a conflict such as:

mainGrid.ManipulationCompleted += MainGridManipulationCompleted;

public void MainGridManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
    var velocities = e.Velocities;
}
jschroedl
  • 4,916
  • 3
  • 31
  • 46
0

So i think i fixed it guys

had to change 'ManipulationCompletedEventArgs' to 'ManipulationCompletedRoutedEventArgse'

mainGrid.ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.TranslateY;
mainGrid.ManipulationCompleted += OnManipulationCompleted;

public void OnManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgse)
{
    var velocities = e.Velocities;
}

EDIT: didnt fully fix it,app crashes when getting velocities

rsharma
  • 169
  • 1
  • 10