0
votes

I'm developing WPF application using PRISM. I have two regions :

Ribbon region (which has got buttons to launch views from different modules) View Region (in which views from different modules will be loaded but one view at a time)

I have separate module assemblies for Ribbon and views (i.e. CustomerModule, OrderModule, etc.). My ribbon has got buttons which should load view from modules i.e. pressing "Customer" button should load the specific view from "CustomerModule", pressing "OrderModule" should load the specific view from "OrderModule", etc.

Can someone provide code snippet on how I should implement the command for my ribbon buttons to launch the view from different module assemblies? I'm not sure on how I can access the view module information into my ribbon module?

Regards,

Krunal

1
^_^ Half-thought it was PRISM (NSA).Ramchandra Apte

1 Answers

0
votes

You can just call the RequestNavigate method of the ViewRegion from each button's command method as corresponds:

void OnCustomerButtonClicked()
{
   this.regionManager.Regions["ViewRegion"].RequestNavigate(new Uri("CustomerView", UriKind.Relative));
}

You should then define every navigation request on each button's command method to properly navigate to the selected View.

You may find more information regarding Navigation on the following Prism Guide chapter:

I hope this helps.