![](/img/trans.png)
[英]How to display other than the first wizard page of an Xtended WPF Toolkit Wizard in designer?
[英]How to bind Xtended WPF Toolkit Wizard's CurrentPage in MVVM?
我已经使用Xceed WPF Toolkit 的 Wizard Control构建了一个包含多个页面的向导,我需要该程序知道当前处于活动状态的页面,以便能够确定必要的步骤。
我正在尝试将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
并且向导只显示一个空白页面。
需要做什么才能让CurrentPage
使用 MVVM 返回活动向导页面?
CurrentStep 应该是一个 DependencyProperty 或者 ViewModel 应该实现 INotifyPropertyChanged,否则绑定将不起作用。
xml:
<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; }
HTH,雷
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.