Reputation: 1964
I am working on a personal project. I started with a previous post (Point of Sale Application Architecture).
Trying to Use- repository - service and View Modal - View approach
Please see the attached image file. Most of my windows will have multiple views.
My Questions are:
The more I look into applying some pattern more I am getting confused
I am sure there are some of you had similar issues and may be your approach might solve things for me.
Thank you Mar
Upvotes: 0
Views: 839
Reputation: 25650
Wayne has good answers for #1 and #2... I'll get #3 and #4.
3) Communication between views that don't share the same view model is done through the EventAggregator in Prism. It's a very easy to use Publisher Subscriber model for messages. You'll have no trouble understanding this.
4) I don't like the idea of having a view as a property of a view model. It's a problem of separation of concerns. You're shooting for your ViewModels to be interface agnostic and this would imply too much interface leaking into your viewmodels. 2 acceptable alternatives would be
HTH, Anderson
Upvotes: 1
Reputation: 6361
I can't see your screenshot but I can give you a little direction here. I've been setting up the shell of a multi-targetted (WPF/Silverlight) composite app recently, learning the libraries as I go.
"Most of my windows will have multiple views." -- this by itself probably means you'll like what you find in the Composite Application Library. And MVVM is a perfect pattern for the CAL. In the StockTrader reference application they use the term PresentationModel, but this is essentially the same thing as MVVM.
Popup modals work great in both WPF and SL (via the Toolkit extension ChildWindow control). You'd communicate with them in same way you would a regular region - by injecting views and services. What I found particularly neat about this is that you can define a region in a popup, register views with it when the app (module) is loaded (even though the region itself is not yet loaded), and then when the region pops up the correct views are injected at that point. In other words you don't have to get involved in deferring the injection of the view until the region is displayed, which I was expecting to have to do.
Haven't tried this -- can't comment.
Not sure about "sub-views", but regions within regions is certainly possible.
Upvotes: 1