I lately had the problem of creating add and edit dialogs for my wpf app.
All I want to do in my code was something like this. (I mostly use viewmodel first approach
I've been using an almost identical approach for several months now, and I'm very happy with it (i.e. I haven't yet felt the urge to rewrite it completely...)
In my implementation, I use a IDialogViewModel
that exposes things such as the title, the standad buttons to show (in order to have a consistent apparence across all dialogs), a RequestClose
event, and a few other things to be able to control the window size and behavior