ApplicationBarMenu
wp7プロジェクトのページにアイコン付きの新しいボタンを追加しました。ページを実行しようとすると、次のようになります。
プロパティ'Microsoft.Phone.Shell.ApplicationBarIconButton.Click'への割り当てに失敗しました。[行:56位置:124]
私が追加した新しいメニュー項目ボタン(2番目のボタンsend_report_button
)を指すもの:
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
<shell:ApplicationBarIconButton x:Name="take_photo_button" IconUri="/Images/appbar.feature.camera.rest.png" Text="Take photo" Click="TakePhotoClick" />
<shell:ApplicationBarIconButton x:Name="send_report_button" IconUri="/Images/mail.sent.png" Text="Send report" Click="SendReportClick" />
<shell:ApplicationBarIconButton x:Name="logout_button" IconUri="/Images/appbar.logout.rest.png" Text="Logout"/>
<shell:ApplicationBar.MenuItems>
<!--<shell:ApplicationBarMenuItem x:Name="menuItem1" Text="MenuItem 1"/>
<shell:ApplicationBarMenuItem x:Name="menuItem2" Text="MenuItem 2"/>-->
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
私は10回チェックしました:にメソッドがあることを確認しました.xaml.cs
:
private void SendReportClick(object sender, RoutedEventArgs e)
しかし、それでも、VSはそれを認識していないようです、または何か他のものが間違っています。
ありがとう