This project has moved. For the latest updates, please go here.

WizardPage do something on display

Mar 30, 2012 at 9:31 AM

Hi All,

I'm trying to use the Wizard control, in a vaguely MVVM fashion (next / previous page for another discussion), however this issue I'm having is getting WizardPage to do some initialisation on display.

I was trying to use interactions and trigger off the PageChanged event of the Wizard control using:

<i:Interaction.Triggers>
         <i:EventTrigger EventName="PageChanged">
            <i:InvokeCommandAction Command="{Binding CurrentPage.DataContext.InitPageCommand, RelativeSource={RelativeSource AncestorType={x:Type extToolkit:Wizard}}}" />
         </i:EventTrigger>
</i:Interaction.Triggers>

However the CurrentPage at this point is the one being left.

And I don't seem to be able to hang any interactions on the WizardPage itself that trigger when it's activated anyone have any pointers

Thanks

Mar 30, 2012 at 11:33 AM

I have a solution! head hurts

xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"

<extToolkit:WizardPage x:Name="wpLicence" DataContext="{Binding LicencePageViewModel}">
	<i:Interaction.Triggers>
		<ei:PropertyChangedTrigger Binding="{Binding IsVisible, RelativeSource={RelativeSource AncestorType={x:Type extToolkit:WizardPage}}}">
			<i:InvokeCommandAction Command="{Binding InitPageCommand}" CommandParameter="{Binding IsVisible, RelativeSource={RelativeSource AncestorType={x:Type extToolkit:WizardPage}}}" />
		</ei:PropertyChangedTrigger>
	</i:Interaction.Triggers>
	<controls:Licence />
</extToolkit:WizardPage>

I received hints from http://stackoverflow.com/questions/6497449/mvvm-binding-to-clr-events