call method in view from view model

Topics: Questions
Nov 5, 2012 at 8:28 AM

Hi forum,

i am new to the catel mvvm framework. IPleaseWaitService does not fit my needs and i need to implement my own custom wait animation. It's a user control that does some animations and it's inside the view. It's not a new window like IPleasewaitService.

Now i want to trigger my user control from viewmodel by calling a method in the view and passing some parameters. How can i access the view from viewmodel? Thanks in advance.




Nov 7, 2012 at 9:11 AM

There are several options here and several questions.

1) You can easily write your own please wait service. You can implement the interface or create a whole new one with your own custom needs, that's up to you.

2) It is perfectly possible to get all the views of a view model. You can query the IViewManager from the ServiceLocator and use GetViewsOfViewModel there. Best is to do this inside the service so your VM does not handle any views.