WPF Xceed Wizard Event in Next button

Viewed 85

I'm creating a Wizard to export DB tables into CSV.

I'm using Xceed Wizard and I need an Event in Next button. I want to validate the parameters before going to the next page when I click "Next", but I only can set CanSelectNextPage.

XAML code:

<xctk:WizardPage x:Name="PageBD1" PageType="Interior"
                                   Title="{DynamicResource  PageBD1Title}"
                                   Description="{DynamicResource  PageBD1Desc}"
                                   NextPage="{Binding ElementName=PageBD2}"
                                   PreviousPage="{Binding ElementName=Page1}"
                                   CanSelectNextPage="False">
                
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="3*"/>
                        <ColumnDefinition Width="5*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <TextBlock x:Name="tbBDInfoServer1" Text="{DynamicResource  tbBDInfoServer1}" Grid.Row="0" Grid.Column="0" />
                    <TextBox x:Name="tbBDServer1" Grid.Row="0" Grid.Column="2" TextChanged="tbBD1_TextChanged"/>

                    <TextBlock x:Name="tbBDInfoName1" Text="{DynamicResource  tbBDInfoName1}" Grid.Row="1" Grid.Column="0" Margin="0,10,0,0" />
                    <TextBox x:Name="tbBDName1" Grid.Row="1" Grid.Column="2" Margin="0,10,0,0" TextChanged="tbBD1_TextChanged"/>

                    <TextBlock x:Name="tbBDInfoUser1" Text="{DynamicResource  tbBDInfoUser1}" Grid.Row="2" Grid.Column="0" Margin="0,10,0,0" />
                    <TextBox x:Name="tbBDUser1" Grid.Row="2" Grid.Column="2" Margin="0,10,0,0" TextChanged="tbBD1_TextChanged"/>

                    <TextBlock x:Name="tbBDInfoPwd1" Text="{DynamicResource  tbBDInfoPwd1}" Grid.Row="3" Grid.Column="0" Margin="0,10,0,0" />
                    <PasswordBox x:Name="tbBDPwd1" Grid.Row="3" Grid.Column="2" Margin="0,10,0,0"/>
                </Grid>
            </xctk:WizardPage>

C# code:

    private void tbBD1_TextChanged(object sender, TextChangedEventArgs e)
    {
        if (tbBDServer1.Text != "" && tbBDName1.Text != "" && tbBDUser1.Text != "")
        {
            PageBD1.CanSelectNextPage = true;
        }
        else 
            PageBD1.CanSelectNextPage = false;
    }

Thanks.

0 Answers
Related