1

I have AddEditViewModel and AddEditView associated with it. I want to start dialog window from ViewModel2 using IWindowManager object. The code from ViewModel2 class:

windowManager.ShowDialog(new AddEditViewModel(_windowManager,_events), 
this.SelectedCar, settings);

but I don't know how to recover the object this.SelectedCar in the AddEditViewModel? Is it possible ?

StepUp
  • 36,391
  • 15
  • 88
  • 148

1 Answers1

1

You can access the object after the dialog has been shown:

var model = new AddEditViewModel(_windowManager, _events);

dynamic settings = new ExpandoObject(); 
settings.WindowStyle = WindowStyle.ToolWindow; 
settings.ShowInTaskbar = true; 
settings.Title = "This is a custom title";

var result = windowManager.ShowDialog(model, null, settings);

var car = model.SelectedCar;
Mark Polsen
  • 149
  • 2
  • 7