c# - WP7/8 Call a DispatcherTimer tick event in the background/lock screen -


i working on timer application windows phone, , trying make if remaining time on timer zero, sound backgroundaudioplayer play, regardless of whether or not application active, inactive, or under lock.

currently, issue tick events don't while application isn't active. user goes application, tick events run point would've otherwise, sound effect (or else) wont play unless application active, or switches being active.

i have in page.xaml.cs:

phoneapplicationservice.current.applicationidledetectionmode = idledetectionmode.disabled; 

the relevant code is:

    void dispatchertimer_tick(object sender, eventargs e)     {         var remaining = this.endtime - datetime.now;         int remainingseconds = (int)remaining.totalseconds;         this.timespan.value = timespan.fromseconds(remainingseconds);          if (remaining.totalseconds <= 0)         {             this.dispatchertimer.stop();             button1.visibility = visibility.collapsed;             button6.visibility = visibility.visible;             this.endtime = datetime.minvalue;             this.timespan.value = timespan.fromseconds(0);             backgroundaudioplayer.instance.play();         }     } 

what can make tick events run while application under lockscreen, or other wise not active?

windows phone has strict limits on background working. may need permission work under lockscreen?

http://developer.nokia.com/community/wiki/run_windows_phone_application_under_lock_screen

but stays application active under lockscreen, not when user press windows or closes app.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -