0
votes

I'm trying to work with unity prism and WPF. What I've done so far is an application that look for module in directory and load it on demand. Everything works pretty well. I can navigate between my module using requestnavigate.

But I'm facing a problem and I can't find any good documentation on this. I have some module who need to continue the execution (run in background). For example, I have a VOIP module and mediaplayer module who need to continue the execution while I'm navigate to another module. Is it possible to use a requestnavigate and maybe thread the previous view/viewmodel until it become the current view ?

1

1 Answers

0
votes

we can run it in separate thread

 // Subscribe to Composite Presentation Events
    var eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();
    var navigationCompletedEvent = eventAggregator.GetEvent<NavigationCompletedEvent>();
    navigationCompletedEvent.Subscribe(OnNavigationCompleted, ThreadOption.UIThread);

Events can be subscribed in separate thread

subscriptionToken = AddedEvent.Subscribe(AddedEventHandler, 
                               ThreadOption.UIThread, false, erFilter);

View-Switching-Applications-with-Prism

PRISM App

Prism-WPF-standalone-and-interaction-modules