Defining WizardPages in separate xaml files

Wizard for WPF Forum

Posted 7 years ago by Jacob Camp
Version: 11.2.0553
Avatar

I would like to do the exact thing described in this thread:

http://www.actiprosoftware.com/community/thread/2476/extending-the-wizardpage-class

Basically we have the AeroWizard defined and we dynamically create the WizardPages depending on the situation and add the WizardPages to the Wizards Items property; they show up in the Wizard but they seem to be stripped of all of the Aero theming and look pretty terrible. The larger blue text, the Caption property of the WizardPage, ends up in a seperate white area with bold black text and the rest of the content on the page looks like it got the default grey color that controls are given. 

Would it be possible to dig up the sample project that your representative fixed and got working correctly in the previous thread? 

Or if the solution to this has changed from 4 years from now is there some example of how to implement this correctly?

Thanks in advance,

--Jake

Comments (1)

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Jake,

Sorry, that has changed in recent builds. You would need to explicitly apply the WizardPage implicit Style. You can do so in the code behind like:

public partial class MyPage : WizardPage {
	public MyPage() {
		InitializeComponent();
		this.SetResourceReference(StyleProperty, typeof(WizardPage));
	}
}

 Or you can do so in XAML like this:

<wizard:WizardPage x:Class="MyProject.MyPage"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:wizard="http://schemas.actiprosoftware.com/winfx/xaml/wizard"
			 Style="{DynamicResource {x:Type wizard:WizardPage}}"
			 >
	<Grid>

	</Grid>
</wizard:WizardPage>

 In either case, you explicitly state that any implicit Styles for WizardPage should also be applied to MyPage.


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.