Several days ago I have received an interesting question for my Windows Phone 7 Application Bar article, where one of my readers has described an exception (InvalidOperationException, “No Fragment support right now”) occurred after the illegal navigation attempt(using Application Bar in App.xaml). Fortunately, I’ve managed to reproduce this issue and, in my opinion, it was caused by the wrong URI. It seems that URI of destination page was to the same as URI of current page in RootFrame and this kind of navigation is not supported.
To prevent this exception from occurring use the lines of code bellow. Same check can be used for the NavigationService.Navigate method.
private void ApplicationBarIconButton_Click(object sender, EventArgs e)
{
Uri navigateUri = new Uri("/PassingParameters/Page1.xaml", UriKind.Relative);
if (RootFrame.CurrentSource != navigateUri)
{
RootFrame.Navigate(navigateUri);
}
}









