1
votes

I have a WPF and PRISM prototype. my project will need to have(at this time):

  • Login window...
  • Principal window (thats have the menu and general informations)
  • A form that will be dynamic(i can have more than 1 form on the showed at the same time)... will load the content of the menu selected option (like products info/list).Like this

My idea was create multiple shells... but i think thats something not needed... I will need to create a shell with 1 region... and 3 views with the respective regions(login, principal and form) ???

How using PRISM i can do it properly or PRISM is not for this way?

3
you can create only one region, then register your different views with the create region using Prism RegionManager, the you have just to Switch between registred views :) - SomeCode.NET

3 Answers

1
votes

You should need a separate service class (DialogService) to launch dialog windows in your application. This service should be injected into your viewmodels. The Dialog Service should have a method to get view name. Resolve your view with name and open your own window with this view.

The following link may resolve your problem,

http://www.codeproject.com/Articles/269364/MVVM-PRISM-Modal-Windows-by-using-Interaction-Requ

1
votes

Prism 5 ships with InteractionRequest class which was part of blend but now it is also available in prism. This allows you to add you custom content. you can find more details in the following two links.

Please take a look at the following new links for Prism 5 which has built in support for interaction requests.

http://msdn.microsoft.com/en-us/library/microsoft.practices.prism.interactivity.interactionrequest(v=pandp.50).aspx

Quickstart

Basically prism ships with a shell type and bootstrapper instantiates it. What all you need to do is to design your shell and which ever the dynamic content is push it to region and then update your region content accordingly.

For dialogs review the above links for prism5.

1
votes

There are some limitation in using Prism popupwindow of InteractionRequest like cannot remove maximize or minimize buttons). Instead of that you can try using

http://blogs.southworks.net/dcherubini/2012/05/24/popupwindowaction-using-custom-views-instead-of-windows-in-wpf-and-prism/

Great thing about this solution is - that you can use custom pop-ups and not only Notification or Confirmation pop-ups.

Also - You can pass information back to the class the invoked the 'InteractionRequest'.

Then for creating region, please check the StockTrader UI

http://msdn.microsoft.com/en-us/library/ff921098%28v=pandp.40%29.aspx