Imagine you have a complex data object. It was difficult enough that for editing various properties of an object it would be better if the user had several screens. This is essentially a basket for customized items.
Thus, one screen will allow you to add items. Another way will allow you to add changes to these elements, predefined changes related to cost. The third screen allows you to configure global settings for your items.
As I’m sure, you can guess that each screen works on the same cart, simply changing the various properties and relations of the elements inside.
So, we will try to write an application using MVVM, and, discussing the various screens (as well as the navigation between them), we came to the following question:
How do people typically manage application state when using MVVM? The navigation bar that users will use to change screens will exist off-screen, but when a user clicks on it, what are some common ways people use it to hide it and show another?
More generally, how do people handle the state of a global application? The user can only work on one cart at a time, there can only be one user at a time, only one screen can be displayed at a time. Would it be better to create a singleton that retains these important properties, and ViewModels could save a copy of them and subscribe to the changes through the event aggregator?
As you can say, I don’t even know where to start this problem, so any advice is generally welcomed and obtained.
wpf mvvm
Anthony compton
source share