TextBox, Button and ListBox in a ListBox

前端 未结 3 1782
盖世英雄少女心
盖世英雄少女心 2020-12-17 07:41

I have a listbox with a bunch of contols in each list item.


    

        
3条回答
  •  失恋的感觉
    2020-12-17 08:08

    I'm assuming your Project ListBox is populated with an Collection of Project objects. I would add an AddNewTask ICommand to the Project class and expose it through a property. Then bind the Add New Task button to the new AddNewTask ICommand. For the CommandParameter, put the TaskName in and it will be passed into the command.

    Try reading up on some MVVM (Model View ViewModel) for some examples of how this works. It is very clean and works great.

提交回复
热议问题