I am making proof of the concept of a WPF application with Prism 4 and Unity, but I am having some basic problems.
In our solution, we have the following projects:
-AppName.Desktop -AppName.Modules.ModuleA -AppName.Modules.ModuleB
Following some teaching aids, studied some examples and searched the Internet, I could not find a suitable answer to a very elementary question; how can i switch between two views in different dlls .
The first view (ModuleAView) is loaded in the Initialize ModuleA method:
public void Initialize() { regionManager.RegisterViewWithRegion("MainRegion", typeof(Views.ModuleAView)); }
When I click on the ModuleAView button (or on the button in ModuleAView), I want to switch to ModuleBView.
public bool SomeEventInModuleAView(SomeEventParams e) { Uri viewNav = new Uri("ModuleBView", UriKind.Absolute); regionManager.RequestNavigate(RegionNames.MainRegion, viewNav); }
Obviously, this will not work, because ModuleA does not know where to find ModuleBView. I read about changing the URI with a package / application / component, etc., but I can't get it to work.
I thought something like this:
Uri("pack://application:,,,/AppName.Modules.ModuleB;component/Views/ModuleBView.xaml", UriKind.Absolute);
Since loading modules from different assemblies is one of Prismβs goals, I think itβs strange that there are no examples in Prism loading to show how this works.