简体   繁体   中英

WP7 fragment error

For a Windows Phone 7 app, I have created an application bar which is common for all my pages and is defined inside App.xaml

For eg. the buttons are Home, Help, About Now, when I start my application, the default page is Home.xaml and the application bar is displayed. When I click Help or About buttons, the navigation is performed using NavigationService and the corresponding page is displayed. But, if I click Home button, an exception is thrown - No Fragment Support at this time.

I found some suggestions where a unique querystring needs to be appended if you are trying to navigate to the same page. Are there any other better solutions?

Also, can anyone suggest any techniques to keep such code in one place so I don't have to repeat this logic on every page for which there is an app bar icon.

Pratik

Mark Chamberlain confirms you can't do this here .

Unique query string is the way around this. Perhaps add something as a query that is an indication of what makes the next instance of this page different.

Alternatively, you could just refresh the content in your page if that is applicable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM