Search code examples
c#silverlightprismmef

Prism Region overlay


I have a silverlight application made with prism. I have a top region where the user can define some information to search, I have another region which is the workspace region who display the data in a datagrid. I would like to add another region on top of the workspace region (like a modal dialog box but a user control that i've defined) which will display the current detail of the selected line when the user double click on the datagrid. What is the best way to do that ?


Solution

  • The following steps were simple enough for me

    1) Create a Region for the overlay in the shell whose visibility is bound to a property in the shell view model

    2) Create a PubSubEvent of bool (Or CompositePresentationEvent according to PRISM version you are using) which will show or hide the overlay region

    3) Make the shell view model subscribe to the event and updates the overlay visibility property depending on the bool value

    4) On mouse double click on a row publish the event and navigate the view in the overlay region