checkbox disabling and enabling in wpf

后端 未结 1 603
旧时难觅i
旧时难觅i 2021-01-23 21:44

IN my below code i have 2 check boxes chkQAReviewMandatory and chkIsAnsMandatory. My requirement is when i check the chkQAReviewMandatory checkbox then automatically i need to

相关标签:
1条回答
  • 2021-01-23 21:53

    There are two ways:

    1. For one control, bind the IsEnabled and IsChecked properties to properties in the ViewModel. On the other control, bind the IsEnabled to the IsChecked. This means that if one checkbox gets ticked, the other one becomes enabled.
    2. You can not only bind to properties in code, you can bind to properties on other controls. Set the name of the control using x:Name, then you can bind to any property on that control.

    As for the details on how to do this, use my answer to find keywords to Google. Good luck!

    0 讨论(0)
提交回复
热议问题