0

While developing an application for windows Phone 7.1 , i encountered the below problem.

I have separate thread for managing my views . And i want this to access the Navigation stack which is a part of the UI thread. How can i achieve this ?

I have a function in my view manager which gets triggerd every time a view change (navigation) occurs.

Any help ?

TutuGeorge
  • 1,972
  • 2
  • 22
  • 42

1 Answers1

3

You could use the Deployment.Current.Dispatcher.BeginInvoke to execute the passed delegate on the UI thread. I am not clear about the specifics of your requirement. Could you add more context? Also, this question has more insight into it.

Community
  • 1
  • 1
abhinav
  • 3,199
  • 2
  • 21
  • 25
  • I need to clear my navigation history, in order to do that i need access to Navigation stack. This action i want to do it in a separate thread. – TutuGeorge Mar 05 '12 at 13:17
  • 2
    BackEntries should be manipulated only on the UI thread. The API is synchronous and should be called from the UI thread. Things could go wrong if you could wipe the stack from another thread. You'll have to pass your methods into the BeginInvoke (as a delegate) to do [this](http://msdn.microsoft.com/en-us/library/system.windows.navigation.navigationservice.removebackentry(v=vs.92).aspx). – abhinav Mar 05 '12 at 13:46