windows phone 8 更换锁屏界面图片
1,打开WMAppManifest.xml.添加2,添加事件
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
页:
[1]