How to communicate across projects inside one .NET solution?

前端 未结 1 1207
忘掉有多难
忘掉有多难 2021-01-13 02:17

I have a .NET Core (UWP solution) application which has 3 different projects (let\'s call them A, B and C).

A and B are Windows Runtime Components, and C is a simple

相关标签:
1条回答
  • 2021-01-13 02:49

    Singleton class won't work here - every process will has its own memory and so its own singleton.

    AFAIK in UWP for inter process (between background tasks and main UI, apart from audio task) communication you will need some kind of a broker. For short synchronization you may think of using LocalSettings, for more complicated scenarios maybe a file/database in LocalFolder. If you decide to use a file you will need to synchronize processes, for this purpose you have objects like Mutex nad WaitHandles.

    0 讨论(0)
提交回复
热议问题