lundi 18 novembre 2019

Binding a checkbox to an event and to the database in MVVM WPF

I have 4 check boxes that receive values from the database. The binding to the database works fine. Now I need to execute code when they are checked or unchecked. They are all defined in xaml as below. Dispute is the model that the data is coming from and ReadyForQM is the field. The database binding works fine as I can change and they save and they are all checked in accordance with the data coming in. What I am lost on is how to add code to my ViewModel that will execute when the user checks or unchecks one of them.

<CheckBox  
    IsChecked="{Binding Dispute.ReadyForQm}" 
    IsEnabled="{Binding IsReadyForQMEnabled}">
</CheckBox>



Aucun commentaire:

Enregistrer un commentaire