UserProfilePersonalizationSettings UserProfilePersonalizationSettings UserProfilePersonalizationSettings UserProfilePersonalizationSettings UserProfilePersonalizationSettings Class


Provides properties and methods to manage the user's desktop wallpaper and lock screen background image.

public : sealed class UserProfilePersonalizationSettings
struct winrt::Windows::System::UserProfile::UserProfilePersonalizationSettings
public sealed class UserProfilePersonalizationSettings
Public NotInheritable Class UserProfilePersonalizationSettings
// This class does not provide a public constructor.

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


using Windows.System.UserProfile;

// Pass in a relative path to a file inside the local appdata folder 
async Task<bool> SetWallpaperAsync(string localAppDataFileName) 
    bool success = false;
    if (UserProfilePersonalizationSettings.IsSupported())
        var uri = new Uri("ms-appx:///Local/" + localAppDataFileName);
        StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(uri);
        UserProfilePersonalizationSettings profileSettings = UserProfilePersonalizationSettings.Current;
        success = await profileSettings.TrySetLockScreenImageAsync(file);
    return success;


To get an instance of this class, call the Current method.


When you set an image more than once, the new image file must have a different name than the previously set image. If you set a new image using a file with the same name as the previous image, it will fail.


Current Current Current Current Current

Gets the current instance of UserProfilePersonalizationSettings.


IsSupported() IsSupported() IsSupported() IsSupported() IsSupported()

Gets a value that indicates whether changing the desktop and lock screen images is supported on the current device.

TrySetLockScreenImageAsync(StorageFile) TrySetLockScreenImageAsync(StorageFile) TrySetLockScreenImageAsync(StorageFile) TrySetLockScreenImageAsync(StorageFile) TrySetLockScreenImageAsync(StorageFile)

Attempts to set the specified image file as the lock screen background image.

TrySetWallpaperImageAsync(StorageFile) TrySetWallpaperImageAsync(StorageFile) TrySetWallpaperImageAsync(StorageFile) TrySetWallpaperImageAsync(StorageFile) TrySetWallpaperImageAsync(StorageFile)

Attempts to set the specified image file as the desktop wallpaper image.