Send parameter from view-model to constructor of another view-model?

I wouldn't use the IoC class in this context, as this is an example of the service locator anti-pattern, and isn't recommended. Rob mentions this in his Caliburn. Micro documentation.

You can also read blog.ploeh.dk/2010/02/03/ServiceLocatorI... for a nice description of the anti-pattern Instead, I would use an abstract factory pattern, and pass (an abstraction of) a factory into your shell view model. This can have methods to create a new logon view model, and messenger view model. In the concrete implementation of this factory, you can instantiate these view models by hand, and just pass in the information they require I would also remove the reference to the shell view model from the logon view model.

Instead, either use standard . NET events which the shell can subscribe to, or have a look at the event aggregator implemented in Caliburn. Micro (a sample is available on the codeplex site), which is an implementation of the mediator design pattern.

This will ensure nice decoupling between your view models.

I wouldn't use the IoC class in this context, as this is an example of the service locator anti-pattern, and isn't recommended. Rob mentions this in his Caliburn. Micro documentation.

You can also read blog.ploeh.dk/2010/02/03/ServiceLocatorI... for a nice description of the anti-pattern. Instead, I would use an abstract factory pattern, and pass (an abstraction of) a factory into your shell view model. This can have methods to create a new logon view model, and messenger view model.In the concrete implementation of this factory, you can instantiate these view models by hand, and just pass in the information they require.

I would also remove the reference to the shell view model from the logon view model. Instead, either use standard . NET events which the shell can subscribe to, or have a look at the event aggregator implemented in Caliburn.

Micro (a sample is available on the codeplex site), which is an implementation of the mediator design pattern. This will ensure nice decoupling between your view models.

Thank for advances, I try implement their... – lop Dec 15 '10 at 14:44.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions