Windows phone 8.1 stop accelerometer -
i developing application windows phone 8.1.
i have if statement:
if(txtx.text==" .24"){ accelerometer.stop(); mainpage.score++; this.frame.navigate(typeof(final_score)); } to explain usage of statement. have value of x axis placed within txtx.text. when x axis of accelerometer equal 0.24 increments 1 score , navigates page. accelerometer not stopping , carrying run on next page. when use statement accelerometer.stop();this not recognised , states
'windows.devices.sensors.accelerometer'does not contain definition 'stop' , no extension 'stop' accepting first arguement of type'windows.devices.sensors.accelerometer' found(are missing using directive or assembly reference?) can or provide function stop accelerometer once value 0.24 met.
thank you.
the class working windows.devices.sensors.accelerometer, not contain stop, looking @ microsoft.devices.sensors.accelerometer documentation (which include stop method)
instead of stop unregister event
if(txtx.text==" .24"){ accelerometer.readingchanged -= yourupdatefunction; mainpage.score++; this.frame.navigate(typeof(final_score)); } btw, idea unregister events when navigating away not duplicate registration events when returning.
Comments
Post a Comment