title: How to open a modal dialog (view) from a ViewModel (in mvvm)
body: <p>I have an application which holds objects in a list view. I want to enable user to change those objects using modal dialogs when an item is double clicked in the list view. </p>
  
  <p>I am using the mvvm light toolkit. When I double click an item in the list view I know which object and therefor which model type is chosen. I am retrieving the corresponding ViewModel via a ServiceLocator and I am using Execute to "launch" the viewmodels' relay command passing the model as object with the needed data information. However, now, in the ViewModel, I am  struggling how to open the corresponding view as a model dialog bound to the ViewModel?</p>
  
  <p>Edit (add some code fragments)</p>
  
  <pre><code>public class ViewModelLocator
  {
      public ViewModelLocator
      {
          SimpleIoc.Default.Register&lt;OptionSpecificViewModel&gt;();
      }
  
      public OptionSpecificViewModel OptionSpecificView
      {
          get
          {                
              return ServiceLocator.Current.GetInstance&lt;OptionSpecificViewModel&gt;();
          }
      }
  }
  </code></pre>
  
  <p>the view locator works fine</p>
  
  <pre><code>public class MyListViewManager
  {
      public void CallMyDialog(Guid xxx)
      {
         var objModel = GetMyModelByGuid(xxx);
         var vm = CommonServiceLocator.ServiceLocator.Current.GetInstance&lt;ObjectSpecificViewModel&gt;();
         vm.EditCommand.Execute(objModel);
      }
  }
  </code></pre>
  
  <p>the "ListViewManager" works also </p>
  
  <p>My Problem is, that I am in the correct ViewModel with the correct model (data). </p>
  
  <pre><code>public class OptionSpecificViewModel : ViewModelBase
  {
      public OptionSpecificViewModel()
      {
          InitRelayCommands();
          RegisterMessages();
      }
      ...
  
      public void OnEditCommand(object model)
      {
          // I reach here in the correct view model with the correct model
          // but how can I open the view here??
      }
  }
  </code></pre>
  
  <p>As far as I understood MVVM, the view model does know the model and the view has a "connection" to the ViewModel via binding.
  But the ViewModel does not know the view. so how do I start the view? </p>