if (UserProfilePersonalizationSettings.IsSupported()) { StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///ninjacat.png")); // , StorageFile localFile = await file.CopyAsync(ApplicationData.Current.LocalFolder,"ninjacat.png", NameCollisionOption.ReplaceExisting); UserProfilePersonalizationSettings settings = UserProfilePersonalizationSettings.Current; bool isSuccess = await settings.TrySetWallpaperImageAsync(localFile); }
using Windows.System.UserProfile; using Windows.Storage;
bool isSuccess = await settings.TrySetLockScreenImageAsync(localFile);
if (UserProfilePersonalizationSettings.IsSupported()) { StorageFile localFile = await ApplicationData.Current.LocalFolder.CreateFileAsync("cat.png", CreationCollisionOption.ReplaceExisting); BackgroundDownloader downloader = new BackgroundDownloader(); DownloadOperation dl = downloader.CreateDownload(new Uri("http://az648995.vo.msecnd.net/win/2015/07/Windows_Insider_Ninjacat_Unicorn-1024x768-Desktop.png"), localFile); await dl.StartAsync(); UserProfilePersonalizationSettings settings = UserProfilePersonalizationSettings.Current; var isSuccess = await settings.TrySetWallpaperImageAsync(localFile); }
using Windows.Networking.BackgroundTransfer;
Source: https://habr.com/ru/post/271943/
All Articles