I'm setting up a wizard. All of my wizard views need access to common data for display like TotalWizardSteps and CurrentWizardStep. I'm trying to find the best way to go about adding this common data to the ViewDataDictionary. I'm thinking of creating my own WizardStepViewPage. This subclass would have a property 'WizardData' which returns a WizardData object. This would allow me to write the following code in my views:
<p>Wizard Step:<%= WizardData.CurrentStep %></p>
The backing store for this WizardData object would be the ViewDataDictionary and some unlikley to reproduce key like "__TheWizardData". I'd set the value at this key with an actionfilter.
This sounds messy, but I think it will work. Is it dumb though? Is there a better way to achieve this?
I want:
- Strongly typed access to wizardData in html markup
- To make my actions ignorant of the need to construct wizardData
- To make my strongly typed viewData classes ignorant of wizardData