Camerabuttons events just not firing in WP7.1 app

北城以北 提交于 2019-12-25 02:20:53

问题


I've diligently followed the instructions at http://msdn.microsoft.com/en-us/library/microsoft.devices.camerabuttons.shutterkeyhalfpressed(v=vs.92).aspx to try and hook the camera events in my WP7.1 Silverlight app. In my main form I have:

   protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        CameraButtons.ShutterKeyPressed += new EventHandler(CameraButtons_ShutterKeyPressed);
    }

And then...

   void CameraButtons_ShutterKeyPressed(object sender, EventArgs e)
    {
        // stuff
    }

However, this event never fires. When I press the camera button, the phone just jumps to camera mode. Am I missing something? I got the sense from the above article that I might need to add the following to my WPAppManifest.xml, because the project was converted from WP7.0:

  <Capability Name="ID_CAP_ISV_CAMERA" />

... but I did that, and nothing much changed. Any ideas?


回答1:


If the capture has not started (CaptureSource.Start), this event will not fire.



来源:https://stackoverflow.com/questions/8442571/camerabuttons-events-just-not-firing-in-wp7-1-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!