2014-01-29 66 views
0

我需要啓動方法,當用戶不是特定的時間量的活性C#Metro風格應用程序用戶閒置時間trigering

我有一個觸發的方法,一個計時器,但我想它像操作復位:

ManipulationStarted, PointerPressed, SelectionChanged, Holding, ItemClick 

這裏是我的計時器:

,但沒有復位定時器:

public void timer_start() 
{ 
    DownloadPromoted(); 
    timer.Interval = new TimeSpan(0, 0, 15); 
    timer.Start(); 
} 

這裏重置我的計時器:

public void timer_stop() 
{ 
    timer.Stop(); 
    timer_start(); 
} 

是有沒有辦法理解,如果用戶正在做metro應用的東西嗎?

回答

0

這還沒有經過測試,但我認爲你可以做到這一點。

Window.Current.CoreWindow.PointerPressed += InputRecieved(); 

private Windows.Foundation.TypedEventHandler<Windows.UI.Core.CoreWindow, Windows.UI.Core.PointerEventArgs> InputRecieved() 
{ 
    IsActive = true; 
} 
相關問題