I am currently developing a C# WPF project. The solution has two projects, one called GUI which contains all the Windows and GUI controls of the program and a second project called coding which contains all the classes and logic to ensure that if I change the logic, it doesn’t affect the working of the GUI.
In the GUI project I have added a reference to the coding project and said using Coding, and this allows me to access the logic classes from the GUI screens.
However, if in the Coding logic class project I want to load a new window from the GUI project how do I go about doing this. If I try and add a reference to the GUI project from the coding project it says that this can’t be done as it creates a circular dependency.
How can I reference both the projects together so that GUI can access logic classes from the coding project and reference the gui project from the coding project so the coding logic class can open a new window from the gui project.
Thanks for any help you can provide.
You can decouple it by introducing the third project
Commonand move out Window and other shared classes into it. ThenGuiandCodingprojects can easily referenceCommon.BTW, try to rethink your design because I’m worried that
Codingproject is aware ofUIentities.EDIT:
In WPF you can decouple UI stuff from a logic by using
Commands, see whether yu can achieve this.