I've found this behavior here whilst searching for a way to open/close windows in viewmodels. I implemented the behavior more or less exactly as stated in that answer, except that I changed the inherited Behavior<UserControl>
to Behavior<Window>
, as I used the behavior in a Window
and not a UserControl
.
Everything worked well until I tried to change the window.Show()
to a dialog window.ShowDialog()
. After closing the newly opened window, it would not reopen again.
I figure that has something to do with the way dialogs work?
Is there a way I can change that behavior so it would work with dialogs as well?
(Or did I actually make a mistake implementing it, causing it not to fully function? (In case it works for other people))