WP7 Timepicker OnNavigatedTo fired again after finishing time selection
I have a page that I am navigating to that does some setup stuff via the 'OnNavigatedTo' event.
Thso page contains a TimePicker control and I have discovered that when I finish in the Timepicker control and focus returns back to my page it is again going through the 'OnNavigatedTo' event.
As a result is doing setup stuff again that is mucking things up, and if even has the same NavigationContext.Quer开发者_运维百科yString as when I originally navigated to that page.
I assume I cannot avoid this event being called again - but is there any way to know that I have come here as a result of exiting the Timepicker control?
- thanks
What about defining a bool in the class (instance-level, not static) that you set check in OnNavigatedTo -- if false, then do your work and set to true. Now, I'm not 100% sure that this works if you go back one level further and then tap on whatever brought up this page, so check that. Also, check to ensure everything works with tombstoning -- that's where you're more likely to have problems.
--randy
精彩评论