Is it possible to reuse a View across multiple ViewModels?

Topics: UI Architecture
Jun 23, 2011 at 11:49 AM
Edited Jun 23, 2011 at 11:50 AM

Well this is my first question on the forum, and I hope it doesn't sound way stupid :)

My intention is to create a reusable View for a 'Confirmation Message Box' and bind it to different ViewModels depending on the context.

So that according to the binding, the View can display a relevant text and the ViewModels can publish relevant messages when the buttons on the View is clicked.

How this is possible along with Caliburn Micro convention to have the Views and ViewModels named in the same manner?

Thanks in advance.

Coordinator
Jun 23, 2011 at 1:29 PM

Do you actually need different view models for the same view? Or do you just want different message texts? Here's a good read http://codesomnia.de/2011/mvvm-dialogs-with-caliburn-micro/

Jun 24, 2011 at 4:56 AM

Yes that is more or less what I was trying to do :) Thanks a lot for the heads up!

I was blindly trying to 'MVVMize' the message boxes and as the link says, I almost forgot what the first 'M' stands for. Thanks again.

Apr 24, 2012 at 2:58 AM

Sorry to bump an old topic, but is this possible? Or is there a better way to handle an add entity / edit entity scenario?