1. Open wmappmanifest. xml. Add
<Extensions>
<Extension extensionname = "lockscreen_wallpaper" consumerid = "{111dff24-aa15-4a96-8006-2bff8122084f}" taskid = "_ default"/>
</Extensions>
2. Add events
Private async void buttonset_click (Object sender, routedeventargs E)
{
Uri nextimageuri;
Nextimageuri = new uri ("file: //" + windows. ApplicationModel. Package. Current. installedlocation. Path + "/defaultwallpaper.jpg", urikind. relativeorabsolute );
Try
{
Bool isprovider = windows. Phone. system. USERPROFILE. lockscreenwallpapermanager. isprovidedbycurrentapplication;
If (isprovider)
{
Windows. Phone. system. USERPROFILE. lockscreenwallpaper. setimageuri (nextimageuri );
}
Else
{
VaR op = await lockscreenwallpapermanager. requestaccessasync ();
}
}
Catch (system. Exception ex)
{
MessageBox. Show (ex. tostring ());
}
} From SDK: lock screen background for Windows Phone