C#コードは次のとおりです
public partial class zoom1: PhoneApplicationPage
{
// Constructor
public zoom1()
{
InitializeComponent(); //the erroe is shown here
}
private async void SetBackground1(object sender, RoutedEventArgs e)
{
if (await LockScreenManager.RequestAccessAsync() == LockScreenRequestResult.Granted)
{
var uri = new Uri("ms-appx:///Assets/LockScreens/People/1.jpg", UriKind.Absolute);
LockScreen.SetImageUri(uri);
MessageBox.Show("Your new lockscreen background has been set.");
}
else
{
MessageBox.Show("You said no, so I can't update your background.");
}
}
}
click="" を AppBarButton に追加すると、エラーが発生します。XAMLコードは次のとおりです
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True" Opacity="0.5" IsMenuEnabled="True">
<shell:ApplicationBarIconButton IconUri="Assets/Buttons/Check.png" Text="Set" Click="SetBackground1"/>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>