1

I am new in MVVM world. I have a question about the child window and I want some explanation. I have some collection of data and I am displaying it in the datagrid of main window. I want to select a item from collection and want to display that data in some Modal Window, Dialog or Popup. I want to edit that data and these changes should be reflected in the datagrid of main window.

Can anyone tell me what is good choice among Modal Window, Dialog and pop up. I am using MVVM Light Toolkit.

User1551892
  • 3,236
  • 8
  • 32
  • 52

1 Answers1

3

In my opinion choise between modal and non-modal window depends only on the UI experience you want to achieve. If for some reason update of the row item can't be done simultanously to other actions on the grid items you need modal one.

As described here Dialog boxes overview

A modal dialog box is displayed by a function when the function needs additional data from a user to continue. Because the function depends on the modal dialog box to gather data, the modal dialog box also prevents a user from activating other windows in the application while it remains open.

Modal dialog would be easier solution as you dont need extra validation on the row you are editing - you simply can edit one row at the time (and I assume you it wouldn't be possible to remove this row in main view while editing in edit window).

If you want to have changes done in child window reflected in your main grid, just use observable collection of items in your main view and pass certain item from this collection as a DataContext of your child window.

  • Thanks for your reply. I am using MVVM light Toolkit. I have one more question. I am confused between dialog services and MVVM light Toolkit messaging and which one of these two is good approach? – User1551892 Sep 24 '12 at 12:09
  • Check Obalix's [answer](http://stackoverflow.com/questions/6595312/creating-an-mvvm-friendly-dialog-strategy/6603347#6603347) in this similar question. – bugged87 Sep 26 '12 at 06:13
  • I am looking for some straight forward example and still I could not find it. Thanks for directions... – User1551892 Sep 28 '12 at 17:51