How RequestNavigate works called from external thread

Topics: Prism v4 - WPF 4
Jan 27, 2011 at 3:22 PM

Hi,

I implemented the prism navigation and the RequestNavigate works well whenever it is called from a button event or something like this. Now I want to implement a demo mode where every view is called from an thread without a user action. But this does'nt work. The RequestNavigate was never called. Got anyone a solution?

Developer
Jan 27, 2011 at 4:01 PM

Hi,

Since navigation is intended to update the UI, the RequestNavigate method should be called from the UI thread. In order to achieve that, you could use a Dispatcher to call that method from the UI thread, or extend the RegionNavigationService (which can be found in the Regions folder of the Prism.Silverlight project of the Prism Library) to internally use a Dispatcher to execute the navigation in the UI thread.

I hope you find this helpful.

Guido Leandro Maliandi
http://blogs.southworks.net/gmaliandi

Jan 28, 2011 at 11:38 AM

Thank you, now I used the Dispatcher and it works!