0
votes

Have begun a WPF app following mvvm pattern and have hit an issue. I have a Customers page which has a number of searches and returns a list of customers. When I double click a record I want to be able to navigate to the Customer view so user can view/edit details.

Is this possible without using MVVMLight or WAF or PRISM(as I have struggled for a bit getting head into PRISM fully!!!) without forcing my view model to have knowledge of my application?

Thanks

2

2 Answers

0
votes

I would use a seperate / underlaying shell view & viewmodel with just the structure of your ui layout (some grids for positioning navigation, menu, search or content areas)

Then position your application views / controls the shell view. (maybe with some Visibility Bindings)

The main purpose of the shell viewmodel is to coordinate the flow of your ui. For example what control should hide or show based on some events of its child controls.

You could use an eventhandler in your search, wich is registered in the shell viewmodel, to show / hide your different content views.

Another approach could be a ContentPresenter.

1
votes

Some people use Dependency Injection to connect VMs with Views in a decoupled way. Take a look at Unity