ItemsControl button click command

后端 未结 4 2071
礼貌的吻别
礼貌的吻别 2021-02-07 21:32

I need some quick help which is a road blocker for me now. I have Button in ItemsControl and I need to perform some task on Button click. I tried addin

4条回答
  •  故里飘歌
    2021-02-07 22:26

    Just a guess. Is CommandDetailsButtonClick defined in a ViewModel, which is DataContext of your UserControl (the one with ListStpRules property)?

    DataContext of button in ItemTemplate is an item from ListStpRules, and if you command is not there then binding won't find it.

    You can check diagnostic messages from wpf in Output window while debugging your application. It writes there if it can not resolve binding.

提交回复
热议问题