My project is written in WinForms (C#). I have WPF user control (implemented as MVVM) that would be placed in the project. Some WinForms user controls should talk/react on changes made in WPF user control. I can think of couple approaches:
- user controls can expose properties. For example: UC3 will have reference to UC4 which will have reference to WPF-UC. UC3 will also have reference to UC2 which will have reference to UC1 and thus UC1 could subscribe to some events in WPF-UC.
- to use some kind of Mediator and thus we keep the dependency to a minimum.
- inject some kind of service which is basically can be Mediator.
I think that approach #2 is the best since I can always move the controls. On the other hand, what kind of cons/pitfalls in this approach can be? What do you think?
If approach #2 is the best is there any library that I can use instead of re-inventing the wheel?
For example, in image below - the TARGET should be updated on WPF UserControl changes. Black - WinForms controls. Red - WPF control.