I am new in windows programming and I need to have communication between 2 projects(UWP and WinRT) in one solution. I was adding the reference of WinRT to my UWP one and now I can call methods from WinRT in UWP, but I need to do and vice versa, from UWP in WinRT , but if I try to add reference Visual Studio is showing an error dialog: Adding this project as reference would cause a circular dependecy
that is quiet logic. So is there a way to make my bidirectional communication even possible?
EDIT
I was trying proposed solutions:
I created a
SharedProject
that contain one C# class like:namespace SharedProject { public interface Iuwp { void myMethodInWinRT(); } public interface Iwinrt { void myMethodInUWP(); } }
I added SharedProject references to both projects: WinRT and UWP;
I implemented
myMethodInWinRT()
in WinRT project andmyMethodInUWP()
in UWP project;As it's metioned here I'd like to call
myMethodInWinRT()
from UWP project andmyMethodInUWP()
from WinRT project but I' getting stuck, how should i use that interfaces to call methods inside them?