Ticket T447965
Visible to All Users

how to dynamically navigate to a Wizard's next page

created 8 years ago

[DevExpress Support Team: CLONED FROM T446777: wizard control - WPF]
Hi Alex,

I am having issues with getting the WizardPage.NextPage to work. When I pass in a view model, nothing happens, and the wizard just calls the ToString().

I was looking at the example and it's quite different from mine. In the example, they bind a list of the same exact view model to item source. My situation is different because I have different types (classes).
I need to understand how to dynamically navigate to a next page. How does the wizard know which view to display if I only pass the view model.

can you please provide an example. Feel free to use the sample project I sent you.

Thanks,

Answers approved by DevExpress Support

created 8 years ago (modified 8 years ago)

Hello,

In the example you provided, there is no any view model, so I have modified the How to: Create a wizard based on a collection of view models example to show how to control what page should be shown in Wizard at the view model level. In case you have different views and view models for your pages, use the Wizard.ItemTemplateSelector to select a required view for each page.
We look forward to your feedback once you have had the opportunity to review the sample project.

Thanks,
Andrey

    Show previous comments (1)
    DevExpress Support Team 8 years ago

      Hello Rem,

      Here are my comments regarding the project.

      1. Handle the OnSelectedItemChanged event to define the SelectedItem property in the view model.
      C#
      protected void OnSelectedItemChanged() { if (SelectedItem == "Simulator") { NextWizardPage = "page1"; } else { NextWizardPage = "page2"; } }

      2) Add two WizardPage controls to the Wizard control to define wizard pages with different content.

      XAML
      <dxco:WizardPage Name="page1" > <pages:RobotConfiguration/> </dxco:WizardPage> <dxco:WizardPage Name="page2" > <pages:RobotConfiguration2/> </dxco:WizardPage>

      Thanks,
      Elliot

        Thank you.
        Your solution seem to work.

        Best,

        DevExpress Support Team 8 years ago

          Hello Rem,

          Thank you for your reply. Do not hesitate to contact us in case of any difficulties.

          Thanks,
          Elliot

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.