0

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)?

1 Answer 1

0

You can implement INavigationAware on your VM's and pass parameters inside query string in your regionManager.RequestNavigate call

Sign up to request clarification or add additional context in comments.

1 Comment

Implementing INavigationAware on my ViewModels didn't work for me. It only worked when implemented on the Views. And as far as I know, I can only pass string through a query string.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.