![]() The class exposes a static method that generates a random badge and sets the badge and tile text. The LockTimer class is implemented for the example project. This is the class specified as the entry point for the background task. The project contains a class that implements the IBackgroundTask interface. The LockScreenExample app references the LockScreenTasks project. This is necessary because of the way the background task will be activated and executed by the system. The task itself is defined in a separate Windows Runtime project that will be referenced from the main project. The entry point references the fully qualified name for a class (namespace and class name) that is used to run the task. To declare the background task, add Background Tasks from the Declarations tab in the manifest. You only have to declare the tasks for the app to compile-the app will run if you never implement the task, but it won’t be very functional for the user! Lock screen apps require that you declare either control channel, timer, or push notification background task. In addition, you must specify a background task. You must specify at a minimum a 24 x 24 pixel monochrome icon to represent your app on the lock screen. The first step is to configure lock screen notifications on the Application tab of the manifest. The LockScreenExample app in the Chapter15 solution folder illustrates the proper way to set up an app to display on the lock screen. Depending on whether you configure the app for badge or badge and tile access, tile updates and badge notifications will automatically propagate to the lock screen for your app. The only difference is that your app manifest indicates it has a presence on the lock screen, and a special lock screen badge is presented. In fact, the same API for updating tiles and badges is used for the lock screen. The lock screen information mirrors the app’s tile and/or badge content. Example lock screen information includes upcoming appointments, current weather conditions, recent emails, and message alerts. If your app has summary information that changes in real time, it may be a candidate for the lock screen. It is possible for apps to present their own information on the lock screen. The Windows 8.1 lock screen provides “at a glance” information to users. Some background tasks are not available unless your app uses the lock screen. These apps take advantage of the lock screen capabilities to provide real-time information to the user. Some background tasks are not available to your app unless you use the lock screen. Programming the Windows Runtime by Example: A Comprehensive Guide to WinRT with Examples in C# and XAML
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |