A little while ago, I wrote this SO post looking for a good way to handle UI and business layer interaction, and I liked the answer which was to use the MVVM pattern.
So I did so quite successfully, but I'm a bit stuck with a problem using this pattern. Indeed, in some part of my UI, one of my buttons is supposed to open a dialog with the details of an item displayed in a ListView
.
I saw this SO post asking about the same question, but I didn't quite understand the answer and I wonder if it is suitable in my case. The idea was to use the Unity framework and to call the window associated with the view in the repository using App.Container.Resolve<MyChildView>().ShowDialog()
, for example.
However, my problem is that I have implemented the ViewModels in project separate from the UI client project. I did this in order to be able to use the VMs from another client if need at a later stage of the project. First question, was that a wrong implementation of the pattern?
Second question, as my ViewModels project isn't actually in the client's project, and hence I do not have access to the App
global variable. Therefore, I don't think I can use the solution I found in the previously mentioned post. Is there any workaround?