Example #1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // Set our initial UI state based on whether the background task is registered.
            IBackgroundTaskRegistration taskRegistration = MainPage.FindBackgroundTaskRegistration();

            UpdateBackgroundTaskUIState(taskRegistration != null);
        }
Example #2
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (MainPage.FindBackgroundTaskRegistration() == null)
     {
         rootPage.NotifyUser(TaskNotRegisteredMessage.Text, NotifyType.ErrorMessage);
         OpenSettingsButton.IsEnabled = false;
     }
 }
Example #3
0
        // Handle request to unregister the background task
        private void UnregisterTask()
        {
            IBackgroundTaskRegistration taskRegistration = MainPage.FindBackgroundTaskRegistration();

            if (taskRegistration != null)
            {
                taskRegistration.Unregister(true);
                rootPage.NotifyUser("Unregistered Caller ID background task.", NotifyType.StatusMessage);
            }
            UpdateBackgroundTaskUIState(false);
        }