Home > Net > How to implement in c # WPF MVVM checkbox checked and unchecked events
How to implement in c # WPF MVVM checkbox checked and unchecked events
Time:09-23
Xaml file code:
Could you tell me how to achieve in the viewmodel checked and unchecked events
CodePudding user response:
Since is the MVVM pattern, so the interface is just data display/operational level, in general event is used to trigger the animation in the View
Don't think about xx xx event do, which is the thinking mode of winform, under normal circumstances ViewMode should not even know the existence of the View, more do not talk about how to go to the events of the corresponding View
In the MVVM pattern, data is the center, through binding with data connection interface, and show/modify data
This data is class attribute, and respond to changes in properties, there is no doubt?
Specific to this case, CheckBox IsChecked attributes should be bound to the ViewModel classes in a single attribute, the ViewModel through the change of the properties for reaction.
CodePudding user response:
Now I just want to in the viewmodel binding command, and can return the checkbox controls