I am new in MVVM/WPF, I was studying web examples for last two weeks but still I couldn't find out how to deal with following thing:
I am working on some sort of "defect inserting software" for our manufacturing department in company. User can "create new record", then based on user's choice different UserControls with different Questions/RadioButtons/ComboBoxes are displayed.
I inspired with great article about Internationalized Wizard , but the wizard in this example is really simple and straightforward.
Following code creates my first wizard steps:
void CreatePages()
{
var welcomePage = new WelcomePageViewModel();
var settings = new SettingsViewModel();
var cellScrap = new WizardChooseCellScrapGradeViewModel(this.CellScrap);
var manufacturer = new WizardChooseManufacturerViewModel(this.CellScrap);
var pages = new List<WizardPageViewModelBase>();
pages.Add(welcomePage);
pages.Add(settings);
pages.Add(cellScrap);
pages.Add(manufacturer);
_pages = new ReadOnlyCollection<WizardPageViewModelBase>(pages);
}
Now when user chooses manufacturer A, program should ask him to fill data in usercontrol_1, if he chooses manufacturer B, then usercontrol_2 will be shown.
Whats the best practice to do this? I suppose I cannot use ReadOnlyCollection for this, any better idea?