just started stydying Prism. Can someone explain what I am doing wrong here...
I have basically 2 regions. 1 region - left menu. 2 region - content. They are all in the shell.
Left menu view and the content views are all in the separate projects.
Now, I would like on some button clicks in the left menu switch the views in the content region.
What i have done: - created NavigationCommand + added it to the composite command (not relevant right now)
public LeftMenuViewModel(IRegionManager regionManager)
{
_regionManager = regionManager;
NavigateCommand = new DelegateCommand<object>(Navigate);
AppCommands.NavigateCommand.RegisterCommand(NavigateCommand);
}
+
public void Navigate (object navigatePath)
{
if (navigatePath !=null)
{
_regionManager.RequestNavigate(RegionNames.ContentRegion, navigatePath.ToString());
}
}
in my leftmenu view i have next piece of code:
dc:ButtonDropDown Header=" Enter New Client" Style="{DynamicResource AppMenuCommandButton}" Command="{x:Static Infrastracture:AppCommands.NavigateCommand}" CommandParameter="ClientNewView"
Now, the command works and hits Navigate method in LeftMenuViewModel, it just refuses to load the content views (from different project) into Content Region, instead it just gives 'System.Object' in the content region.
I assume the problem is in this line of code:
_regionManager.RequestNavigate(RegionNames.ContentRegion, navigatePath.ToString());
we can't just load the views from different project?
Do I have to register the views with the container in the Content Views project? Like this:
_container.RegisterType<object, ClientNewView>(typeof (ClientNewView).FullName);
?
thanks for any help !