Determining checked Radiobutton from groupbox in WPF following MVVM

后端 未结 5 1795
有刺的猬
有刺的猬 2021-02-05 13:44

I have a groupbox with some radiobuttons. How do I get to know which one which is checked? I am using WPF and following MVVM.



        
5条回答
  •  一个人的身影
    2021-02-05 14:00

    you can bind RadioButton.Command of Radiobuttons to a command of your ViewModel and send a unique CommandParameter to identify which button has called the command in commandhandler.

    
    
    
    

    in command handler check for parameter to identify the radiobutton.

    Thanks

提交回复
热议问题