Developing wizard UI - WPF

筅森魡賤 提交于 2019-12-03 06:41:30

I'd probably aproach this using data binding and template selectors. Have the wizard form bind to a "WizardData" class, which exposes a list of "WizardPage" base classes.

The WizardData class can expose properties defining the correct info on the forms, and display a control for the main page that uses a template selector to determine the proper control to display based on the actual type of the particular wizard page.

It sounds like more work than it is, really. It also gives you the benefit of good separation between code and UI (all "work" is done by the WizardData and WizardPage classes), and the ability to test logic independent of the UI.

It's also a very WPF/MVVM way of approaching the problem.

Check this link: http://www.codeproject.com/KB/WPF/InternationalizedWizard.aspx This is the article about building wizard in WPF by Josh Smith, it's seems to be nice pattern. I found it's helpful for me, hope you'll too.

There is also an open source Avalon Wizard control on codeplex.

I recognize this does not directly address your question, but I thought I'd mention it as a possible alternative. I've used Actipro's Wizard control with pretty good results, and when I have needed support, they have been very responsive. I am not affiliated with them in any way; I just like not having to write the plumbing to manage a wizard.

Jonathan Allen
  1. The property is called "Visibility".
  2. I find that I do better when I dynamically add and removing controls rather than hide them.

I was looking for a Wizard solution too. I have the need to stick with stock WPF components so I implemented the wizard using a standard form and a tab control.

I only hide the tabs at runtime so there available in the IDE. At runtime just use Back, Next, Finish... to navigate thru the tab items

works good

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!