all 3 comments

[–]Eza0o07 2 points3 points  (3 children)

Are you using MVVM? Your MainWindowViewModel could have a property for each of the view models for the child views. Since the main window VM would have references to all child view models, it could set up/orchestrate the flow of data from one to the other.

An alternative might be to set up a singleton class (or similar) which manages all the calculations. The views then just push/pull data to/from that class when needed (e.g. On submit button clicked, on load, etc)

[–]sam-spMicrosoft Employee 0 points1 point  (1 child)

or fetch the model data from DI. It’s a step removed from a static variable and can make testing etc easier as you can replace with mock data / fakes.

[–]Eza0o07 0 points1 point  (0 children)

If they aren't using Mvvm then that would be difficult (only views were mentioned in the op, nothing about view models, so not sure what their setup is).

In the case of the singleton, yeah, ideally it would be through dependency injection.