How can I bind an ItemsControl.ItemsSource with a property in XAML?

后端 未结 4 557
半阙折子戏
半阙折子戏 2021-01-17 14:03

I have a simple window :



        
4条回答
  •  不知归路
    2021-01-17 14:39

    What @JesseJames says is true but not enough.

    You have to put

    private ObservableCollection Activities { get; set; } 
    

    as

    public ObservableCollection Activities { get; set; }
    

    And the binding should be:

    
    

    Regards,

提交回复
热议问题