Reputation: 1
I have a wpf application that contains a few pages for the user to enter data. I need to store this data until the user finishes their input and I need to get this data and print it out for verification.
I know that there is a dictionary that is able to store the keys and data, but how do I store the data from the starting page until the final page? Create a class file to store the data or is there any other better solution to solve this problem?
Upvotes: 0
Views: 835
Reputation: 179
One way to do this would be to have a class whose responsibility will be to orchestrate between the viewmodels for all the views that you will be displaying as part of capturing the user input. This orchestrator class will have the instance of the dictionary (which will hold all user inputs). Since view models for all your views will be instantiated/ resolved from unity within your orchestrator, they can get the dictionary instance from it and keep enriching in each step.
Upvotes: 0
Reputation: 1858
It is a big question probably more to do with your domain model that with WPF. It sounds like you have a collecton of data. This collection must be something ... i think it will have a name. e.g. "Results", "Survey", or "Bill of materials". So model that and model the data.
Now talking the WPF stuff, each data entry page will "bind" to an individual "data" model. Whatever the user is using to navigate through the data will bind to the collection thing.
Keywords you want to lookup:
Start small. You have a long rich path.
Upvotes: 2