Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何绑定扩展WPF工具包向导&x27;MVVM中的当前页面是什么?_C#_Wpf_Mvvm_Wizard_Wpftoolkit - Fatal编程技术网

C# 如何绑定扩展WPF工具包向导&x27;MVVM中的当前页面是什么?

C# 如何绑定扩展WPF工具包向导&x27;MVVM中的当前页面是什么?,c#,wpf,mvvm,wizard,wpftoolkit,C#,Wpf,Mvvm,Wizard,Wpftoolkit,我已经使用构建了一个包含多个页面的向导,我需要程序知道当前处于活动状态的页面,以便能够确定必要的步骤 我正在尝试将CurrentPage绑定到ViewModel,如下所示: XAML: <xctk:Wizard CurrentPage="{Binding CurrentStep, Mode=TwoWay}"> <xctk:WizardPage Name="Import"> ... </xctk:W

我已经使用构建了一个包含多个页面的向导,我需要程序知道当前处于活动状态的页面,以便能够确定必要的步骤

我正在尝试将
CurrentPage
绑定到ViewModel,如下所示:

XAML:

<xctk:Wizard CurrentPage="{Binding CurrentStep, Mode=TwoWay}">
    <xctk:WizardPage Name="Import">
       ...
    </xctk:WizardPage>
       ...
</xctk:Wizard>
public WizardPage CurrentStep { get; set; }
问题是
CurrentStep
总是返回
Null
,向导只显示一个空白页面


要使用MVVM返回活动的向导页面,需要执行哪些操作?

CurrentStep应为DependencyProperty或ViewModel应实现INotifyPropertyChanged,否则绑定将不起作用。

xaml:

<xctk:Wizard    x:Name="wizMain"
                Grid.Row="1"
                FinishButtonClosesWindow="True" 
                ItemsSource="{Binding wizardPages}" 
                Background="White"
                ExteriorPanelMinWidth="100"
                HelpButtonVisibility="Hidden"
                CanSelectNextPage="{Binding CanProceed, UpdateSourceTrigger=PropertyChanged}"
                CurrentPage="{Binding Path=CurrentWizardPage, Mode=TwoWay}"
>
嗯,, 射线

public WizardPage CurrentWizardPage { get; set; }