samedi 9 décembre 2017

WPF MVVM Window Reflection

I researched a bit about the MVVM Pattern in WPF and I read about that a ViewModel should not know about the other Windows. For Example if I want to open another window to my main window I cannot just reference to it and call the constructor.

So i thought a bit about that problem and I want to know your opinion about my idea. What if I code a static class which has a method in it that takes a string as parameter and gets the window with reflection out of a folder in my project, and creates the instance. Is this a good or a bad idea?





Aucun commentaire:

Enregistrer un commentaire