RadWizardPage WPF

2 Answers 32 Views
Window Wizard
Marco
Top achievements
Rank 1
Iron
Marco asked on 31 Jan 2024, 02:37 PM

Hello everyone,

 

on my WPF application I have to use a WizardPages component to make a configuration. These configuration (and the relative pages) may changes based on a combobox item selectable on the first WizardPage (a page in common for all configurations).

My question is.... It's possible to add WizardPages dynamically based on the selection on the combobox of first page?

 

Thank you

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 02 Feb 2024, 11:40 AM

Hello Marco,

Yes, you can do that by utilizing the Pages collection of RadWizard in code-behind. You can add and remove pages, like so:

//add
this.wizard.WizardPages.Add(new WizardPage() { Content = "page content" });

// remove
this.wizard.WizardPages.Remove(wizardPage);

Regards,
Martin Ivanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Marco
Top achievements
Rank 1
Iron
answered on 02 Feb 2024, 02:25 PM

Thank you for help.

 

But there's a manner to do the same thing in XAML?

 

 

Martin Ivanov
Telerik team
commented on 02 Feb 2024, 02:56 PM

No, dynamic adding of pages can be done only in C#/VB. But you can create their contents in XAML, then assign this via the Content or ContentTemplate property of the WizardPage class.

this.wizard.WizardPages.Add(new WizardPage() { Content = new MyUserControl()  }); // where you use the XAML of MyUserControl to design your page view

this.wizard.WizardPages.Add(new WizardPage() { ContentTemplate = (DataTemplate)this.Resources["MyDataTemplate"] )  }); 

Tags
Window Wizard
Asked by
Marco
Top achievements
Rank 1
Iron
Answers by
Martin Ivanov
Telerik team
Marco
Top achievements
Rank 1
Iron
Share this question
or