I am using Prism in an application and I need a way to run call a function every time a module is requested. The thing is that this function will query the database for some items, and I need to do this every time the module is requested by pressing the module item buttom from a menu. I tried adding this to the constructor, but the problem is that the constructor is called during the initialization of the application from the bootstrap!
Is there a simple way to do this?
How are you requesting your module? One way to do this is to use EventAggregation, and have the modules listen for specific events which will tell them they are requested. If you use EventAggregation to request you modules you will have an event handler that handles the request event. Hopefully you should be able to use your event handler to call your function too.