Next, you can see the code that I use to invoke the page if a shake event occurs. However, the page appears, but at the same moment the application freezes, and I can not do any further user input, for example, by pressing a button.
void accelerometer_ReadingChanged(object sender, AccelerometerReadingEventArgs e)
{
if (e.X > 1.5)
{
Dispatcher.BeginInvoke( () => {
NavigationService.Navigate(new Uri("/Bars/DetailBar.xaml", UriKind.Relative));
} );
}
}
the debugger tells me that "NavigationFailed" and that there is a "System.NotSupportedException". What's wrong?
source
share