Mam następujący kod:Uchwyt Przesuń w górę, przesuń w dół, przesuń w lewo i przesunięcie w prawo Gesty w app WinRT
public MainPage()
{
this.InitializeComponent();
this.ManipulationStarting += MainPage_ManipulationStarting;
this.ManipulationStarted += MainPage_ManipulationStarted;
this.ManipulationInertiaStarting += MainPage_ManipulationInertiaStarting;
this.ManipulationDelta += MainPage_ManipulationDelta;
this.ManipulationCompleted += MainPage_ManipulationCompleted;
}
void MainPage_ManipulationStarting(object sender, ManipulationStartingRoutedEventArgs e)
{
Debug.WriteLine("MainPage_ManipulationStarting");
}
void MainPage_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
{
Debug.WriteLine("MainPage_ManipulationStarted");
}
void MainPage_ManipulationInertiaStarting(object sender, ManipulationInertiaStartingRoutedEventArgs e)
{
Debug.WriteLine("MainPage_ManipulationInertiaStarting");
}
void MainPage_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
Debug.WriteLine("MainPage_ManipulationDelta");
}
void MainPage_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
{
Debug.WriteLine("MainPage_ManipulationCompleted");
}
Ale nie mam pojęcia, w jaki sposób korzystać z wydarzeń manipulacji. Czy ktoś może opisać, jak obsługiwać gesty przesuwać w górę, w dół, w lewo i prawo?
Nie pracowałem z gestami WinRT, ale szybko rzuciłem okiem na MSDN i założyłem, że można uzyskać dostęp do różnych właściwości argumentów podczas zdarzeń "Delta" (lub innych). Na przykład 'ManipulationDeltaRoutedEventArgs.Velocities' ma zestaw danych dotyczących wejść/kątowych/skalowania wejść od użytkownika. Nie mogę powiedzieć, czy to jest "ten", na który powinieneś patrzeć, ale może da ci to początek. –