0

I have a listview which displays a list of Users (binds to UserListViewModel) - the user can add/edit/delete entries. What I would like to do is have the add button open a new window where the user can enter the new details and save. When the save is successful, I want the window to close and the listview to be refreshed to show the new addition.

What is the best approach for doing this using the MVVM pattern? I've read about using events, modal dialogs, etc, and the accepted answer to this question had a description of what i'm aiming for, but I can't seem to find an example of how this is implemented.

Can someone provide an example?

Update: I ended up finding (read: stumbling across) this article which suits my purposes.

Community
  • 1
  • 1
serachley
  • 7
  • 3

1 Answers1

0

I would go with interactions. This way you will be able to start interaction, pass data to it and then after it's done/closed - get some data back to update your VM.

Download MVVM in a box and they have example of testable MVVM-ish interactions: http://karlshifflett.wordpress.com/2010/11/07/in-the-box-ndash-mvvm-training/

katit
  • 17,375
  • 35
  • 128
  • 256