1

My question seems a fairly simple one, but after hours of searching I found nothing that could solve my problem.

I am developing a calendar app and I need to keep it up to date so it would always show the current day correctly. The case I can't solve is when the user changes the system date manually.

I found this question and SystemEvent.TimeChanged would be the exact thing I am looking for. Sadly, it's not present in UWP. Is there a substitute of any kind for it?

I also stumbled upon the TimeZoneChange value of SystemTriggerType, but I tested it with the background task sample and it only works when the system time changes due to time zone change (as the documentation states). It's nice and it's close to my problem, but clearly not a sufficient solution.

Community
  • 1
  • 1
Péter Bozsó
  • 1,294
  • 8
  • 18
  • If your app runs in the foreground, it seems like a simple thing to do with a timer. However, if your app runs is suspended, there's no way to achieve this. The BackgroundTask does not support TimeChanged SystemTrigger, which seems too costy for a background task. – Jackie Jan 26 '16 at 12:54
  • Thanks for your help, I thought about it too, but it's not the exact problem I am facing. I updated my question to be more accurate. – Péter Bozsó Jan 26 '16 at 15:09
  • Is it really a common use case that users are changing the system date/time settings on their machine while your app is open? This seems like more of a theoretical requirement than an actual need for someone with a calendar app. If users really are doing this a lot have you investigated why? It may be a workaround for some other issue that you may be better able to solve another way. – Matt Lacey Jan 28 '16 at 16:33
  • No Matt, you are right, it's not a very likely use case. I'd just like to be prepared for everything, that's all. :) – Péter Bozsó Jan 28 '16 at 17:02

1 Answers1

0

Will the TimeTrigger class be helpful for you in this instance?

Batuta
  • 1,684
  • 17
  • 48
  • 62
  • " Note that your app must be placed on the lock screen, and the background task must be declared in the manifest, before the registration can be successful." – ChrisF Jan 26 '16 at 14:26
  • Yep, as Chris says. Sorry, it's really not what I am looking for. – Péter Bozsó Jan 26 '16 at 14:35
  • 1
    Actually, [this documentation](https://msdn.microsoft.com/en-us/library/windows/apps/mt186458.aspx) says that "Starting with Windows 10, it is no longer necessary for the user to add your app to the lock screen in order to utilize background tasks". – Andrei Ashikhmin Jan 26 '16 at 15:46
  • Hah, right! Still not exactly what I am looking for, I stumbled upon this myself too while searching. – Péter Bozsó Jan 27 '16 at 12:17