I am working on a WPF application and using the Model-View-ViewModel template.
The application consists of two modules at the moment:
- Left panel to view the tree and select node
- The main panel for displaying the contents of the selected node tree.
I want the two modules to be separated, but when I select node in the left pane, I need to fire an event that the Main Panel can subscribe to. I don’t want to link the Left and Home panels, so I don’t want to share instances of ViewModel classes.
Optimally, I would like to use Prism (WPF Composite Application Guidance), but I am currently expanding an existing application and cannot introduce more dependencies. The project is also on .NET 3.0 (not 3.5), so I would have to convert Prism back to .NET 3.0 since it was written for .NET 3.5.
In Prism, I would solve this using the Event Loosely Coupled infrastructure. It allows you to trigger an event in any class at any level and listen to any event in any class at any level. Mostly the publisher and subscriber of the event are untied.
I use Commands to achieve this loose connection between my view and my ViewModel, but I'm not sure how to cross-view correctly.
Any advice or suggestions are welcome.
pub/sub .NET 2.0/3.0 ( LINQ), - , () .
. , . EventService ( CommandProxy) ViewModel ( IoC). CommandProxy MultiDelegateCommants, DelegateCommand Prism (Composite WPF Guidance). , .