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; }