vendredi 22 décembre 2017

WPF Checkbox Command for Unchecked and Checked

I have the following line in a .XAML file:

<CheckBox x:Name="checker"  Grid.Column="1" Grid.Row="6" Command="{Binding LoadCommand}"></CheckBox>

Now my question is - what is the best way to have different Commands for the checkbox "checked" and checkbox "unchecked".

In my ViewModel I have two different functions (LoadCommand and LoadActiveCommand), one should be loaded when the checkbox is checked and the other when the checkbox is unchecked.

What is the best way to get the result I wish? Is there a way to do it directly in the .XAML file or do I have to do this in xaml.cs?




Aucun commentaire:

Enregistrer un commentaire