I have a WPF application that I am trying to keep as close to MVVM as possible. I have a class TitlesModel : MappedViewModelCollection<TitleEditModel, Title>
, where MappedViewModelCollection
, which has a property public ObservableCollection<TViewModel> Items { get; set; }
, which is bound to a DevExpress GridControl
. Each row in the control has an Edit and Delete button. When this button is pressed, I would like to bind the TitleEditModel
for that row in the grid to a view that is a popup, modal window.
Do I 'tell' the main view model this, and let it instantiate, bind, and show a popup, or merely instantiate a popup, pass the row's EditViewModel
to it and let it do it's own thing?
What is the conventional pattern for grid/detail view scenarios like this?