This project has moved and is read-only. For the latest updates, please go here.

Wizard Control template

Oct 14, 2012 at 12:32 AM

I tried to extend Wizard custom control and so that there are three wizard type available now

  • NormalWizard (default template
  • WithStepsOnLeft (modified to show list on the left style of the wizard with active page highlighted
  • Mixed (Combines both default and listed mode but keeps header and page types from default WizardPage

My problem here is that Now I want to modify Wizard style so it changes its main template based on WizardType DependencyProperty of type Enum.

I tried to do something like the one below but Visual Studio does not see resource.

<Style TargetType="{x:Type local:Wizard}">
        <Trigger Property="WizardType" Value="Normal">
            <Setter Property="Style" Value="{StaticResource StandartWizardTemplate}" />

<Style x:Key="StandartWizardTemplate" TargetType="{x:Type local:Wizard}">
    <Setter Property="Background" Value="#F0F0F0" />
    <Setter Property="BorderBrush" Value="#A0A0A0" />
    <Setter Property="BorderThickness" Value="1" />
    <Setter Property="ItemsPanel">
                <Grid />
    <Setter Property="Template">
    //Content of default template before modification

I have also tried to set not a style but Template so Extracted Control template as a resource with key from
default style and on trigger tried to set template value but still was not able to see resource in intelligence
and resource was not recognized.

please someone point me to the right directon what should I do to implement this scenario


Oct 14, 2012 at 12:45 AM
Edited Oct 14, 2012 at 12:45 AM

Ok The Only way Resource dictionary can see template is in this way



        <Setter Property="Template">
                <ControlTemplate TargetType="{x:Type local:Wizard}">
                        <Trigger Property="WizardType" Value="Normal">
                            <Setter Value="{DynamicResource NormalModeWizard}"/>



But is this correct and why should I use DynamicResource instead of StaticResource?