I'm working with Prism and I have a view which will manage some variable entity objects.
E.g.: Now I'm managing a User
, but later I would manage a Customer
using the same view (I already have the solution to achieve it ... link 1 - link 2).
This object (or the object type) to be managed must be declared and passed by me.
In a common way, I could pass the object type through a parameter on the constructor, but as I'm using Prism and I don't directly use the constructor of the Views or ViewModels.
Here's a snippet of how I currently "invoke" my views:
var regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
var viewUri = new Uri("MyGenericView", UriKind.Relative);
regionManager.RequestNavigate("AreaTrabalho", viewUri);
The problem is: I can't pass a parameter. Is there a way of passing that parameter or an alternative way of doing this (without a kind of ugly hack)?