private void RegisterBackgroundTask() { var settings = ApplicationData.Current.LocalSettings; var task = WallpaperTaskConfig.RegisterBackgroundTask(WallpaperTaskConfig.WallpaperTaskEntryPoint, WallpaperTaskConfig.WallpaperTaskName, trigger, null); AttachProgressAndCompletedHandlers(task); }
protected override void OnNavigatedTo(NavigationEventArgs e) { foreach (var task in BackgroundTaskRegistration.AllTasks) { if (task.Value.Name == WallpaperTaskConfig.WallpaperTaskName) { WallpaperTaskConfig.UpdateBackgroundTaskRegistrationStatus(WallpaperTaskConfig.WallpaperTaskName, true); break; } } trigger = new ApplicationTrigger(); }
private void UnregisterTask_Click(object sender, RoutedEventArgs e) { WallpaperTaskConfig.UnregisterBackgroundTasks(WallpaperTaskConfig.WallpaperTaskName); }