Creating Alarm Application for Windows Phone
I don’t have a kitchen timer, but who cares? I have a Windows Phone, right? So I just created a little Alarm application to compensate for missing kitchen equipment.
It is a very simple application that has a TextBlock (for instructions), a TextBox, where I can set the alarm (I chose to set that in seconds), and two buttons. One for setting the alarm, the other one for resetting it:
By clicking the ‘Set Alarm’ Button I set the alarm. A method called ‘CreateAlarm’ will be created. This method will create the instance of the alarm by passing a name to the constructor. I am also going to add a little alarm message:
“ScheduledActionService.Add(alarm)” will let the alarm go off when the application has been closed. It will execute in the background.
Works as expected. I just have to make sure to press the ‘Reset Alarm’ Button after an alarm went off, to prevent it from crashing. I am sure there is room for improvement, but for now, I am happy with that.
To be continued…
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)