2013-12-13 56 views
2

我正在尋找解決方案,通過「滑動」提示在我的主頁和子頁面之間進行導航。Windows 8商店應用 - 滑動手勢導航

ATM返回的唯一方法是返回按鈕,但是如果檢測到左側的滑動操作以導航回主頁面,將會很不錯。

我該如何做到這一點?

回答

2

您必須使用操作事件。看看here

示例左輕掃:

Point start; 

void ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e) { 
    start = e.Position; 
} 

void ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e) { 
    if (e.IsInertial) { 
     if (start.X - e.Position.X > 500) //swipe left 
     { 
      e.Complete(); 
     } 
    } 
}