public async static Task ChangeWallpaperAsync() { var url = UnsplashImageFactory.CreateTodayHighlightImage().Urls.Full; var result = await DownloadAndSetAsync(url); Debug.WriteLine($"===========result {result}=============="); }
public static async Task UpdateLiveTileAsync() { try { var tile = new TileBinding(); var photosContent = new TileBindingContentPhotos(); var url = UnsplashImageFactory.CreateTodayHighlightImage().Urls.Full; photosContent.Images.Add(new TileImageSource(url)); tile.Content = photosContent; var tileContent = new TileContent { Visual = new TileVisual() }; tileContent.Visual.Branding = TileBranding.NameAndLogo; tileContent.Visual.TileMedium = tile; tileContent.Visual.TileWide = tile; tileContent.Visual.TileLarge = tile; await ClearAllTileFile(); TileUpdateManager.CreateTileUpdaterForApplication().Clear(); TileUpdateManager.CreateTileUpdaterForApplication().Update( new TileNotification(tileContent.GetXml())); } catch (Exception e) { var task = Logger.LogAsync(e); } }
public async void Run(IBackgroundTaskInstance taskInstance) { Debug.WriteLine("===========background task run=============="); var defer = taskInstance.GetDeferral(); var url = UnsplashImageFactory.CreateTodayHighlightImage().Urls.Full; var result = await SimpleWallpaperSetter.DownloadAndSetAsync(url); Debug.WriteLine($"===========result {result}=============="); defer.Complete(); }