C# 复选框中的项目未显示

C# 复选框中的项目未显示,c#,wpf,xaml,C#,Wpf,Xaml,我正在使用WPF Extended Toolkit()中的CheckListBox项,我试图列出一些复选框项,但它不起作用 这是我的XAML: <xctk:WizardPage x:Name="IntroPage" Title="Welcome" Description="This Wizard will walk you though something."

我正在使用WPF Extended Toolkit()中的CheckListBox项,我试图列出一些复选框项,但它不起作用

这是我的XAML:

<xctk:WizardPage
            x:Name="IntroPage"
            Title="Welcome"
            Description="This Wizard will walk you though something.">
            <xctk:CheckListBox
                Command="{Binding FeatureSelectedCommand}"
                ItemsSource="{Binding Features}"
                SelectedItemsOverride="{Binding JustSelectedFeatures}" />
... etc

... 等
这是我的.cs代码:

public partial class WizardWindow : Window
{
    public ObservableCollection<string> Features { get; set; }
    public ObservableCollection<string> JustSelectedFeatures { get; set; }

    public WizardWindow()
    {
        InitializeComponent();

        Features = new ObservableCollection<string>(new List<string>(new string[] {
                "item1",
                "item2",
                "item3"}));

        JustSelectedFeatures = new ObservableCollection<string>(Features);
    }

    ... etc
    
公共部分类向导窗口:窗口
{
公共ObservableCollection功能{get;set;}
public ObservableCollection JustSelectedFeatures{get;set;}
公共窗口()
{
初始化组件();
Features=新的ObservableCollection(新列表(新字符串[]){
“项目1”,
“项目2”,
“项目3”);
JustSelectedFeatures=新的可观察集合(Features);
}
等

为什么CheckListBox没有用这三个项目更新?列表功能应该更新CheckListBox,但它没有更新,我不知道为什么。

表达式
ItemsSource=“{Binding Features}”
要求检查列表框的DataContext包含绑定的源对象,即具有Features属性的类的实例。DataContext的值通常从父窗口或页面继承。因为这里的窗口/页面也是拥有源属性的类,所以设置
DataContext=this;
在窗口/页面构造函数中。它在添加
DataContext=this
后工作,谢谢!