I have a user requirement: Select an item in a list. Click on a button. Dialog-mode window opens showing details of that item (window behind doesn’t disappear).
Hence, I’m trying to find the simplest way of opening a second View from a first View and passing through information about which item is selected in a bound DataGrid. I found an example about opening a View from the ViewModel on the Microsoft website here, which is fairly simple here, but it doesn’t include a mechanism to pass through the selected item in the DataGrid. I can use this code, but I don’t know how to get hold of the selected item.
Coming from winforms, an equivalent solution might be something as simple as this:
EditForm frm = new EditForm(lvw.SelectedItem[0].Text);
At the moment, I’m looking for a solution with the minimum amount of library/framework/service/abstraction, so that I can actually understand what is going on.
Hence my question is, how do I make available in the most simple way within the calling ViewModel, the information about which item is selected in a DataGrid, and pass that through to the secondary View/ViewModel pair, so I can use it to load the Model and bind the View to it.