Let\'s imagine I have some user control. The user control has some child windows. And user control user wants to close child windows of some type. There is a method in user
A reasonable way for purists is creating a service that handles your navigation. Short summary: create a NavigationService, register your view at the NavigationService and use the NavigationService from within the view model to navigate.
Example:
class NavigationService
{
private Window _a;
public void RegisterViewA(Window a) { _a = a; }
public void CloseWindowA() { a.Close(); }
}
To get a reference to NavigationService you could make an abstraction on top of it (i.e. INavigationService) and register/get it via a IoC. More properly you could even make two abstractions, one that contains the methods for registration (used by the view) and one that contains the actuators (used by the view model).
For a more detailed example you could check out the implementation of Gill Cleeren which heavily depends on IoC:
http://www.silverlightshow.net/video/Applied-MVVM-in-Win8-Webinar.aspx starting at 00:36:30