PRISM WPF How to change view in region using event?

Viewed 26

I am creating my first wpf application MVVM using Prism. My applications looks like: MainScreen

I have no problems with navigation using delagete commands from buttons with _regionManager.RequestNavigate.

Unfortunatly it doesn't work when I want to change Red View using UsingEventAggregator.

        _ea = ea;
        _ea.GetEvent<GTM1Event>().Subscribe(ChangeView);

EventAggregator works correct, its change also values of Orange View variables and make regionmanager.RequestNavigate but it doesnt change red View.

How should it be done?

1 Answers

You might be in background thread.. try

_ea.GetEvent<GTM1Event>().Subscribe(ChangeView, ThreadOption.UIThread);
Related