Exemple #1
0
        /// <summary>
        /// Run the background task
        /// </summary>
        /// <param name="taskInstance">Returns task informations</param>
        public async void Run(IBackgroundTaskInstance taskInstance)
        {
            BackgroundTaskDeferral deferral = taskInstance.GetDeferral();

            try
            {
                ToastManager manager = new NewsToastManager();
                await manager.CheckAndDisplayAsync();
            }
            finally
            {
                // Informs the system task is finished
                deferral.Complete();
            }
        }