jeudi 1 septembre 2016

WPF bind ComboBox with CheckBox

I would like to bind a ComboBox with a CheckBox so that the ComboBox is enabled when the CheckBox is not checked. Can I do that directly in the xaml file, without adding any additional variable in the code?
In the code below, myComboBox is enabled when myCheckBox is ckecked.

<ComboBox Name="myComboBox" SelectedIndex="0" 
     IsEnabled="{Binding ElementName=myCheckBox, Path=IsChecked}">




Aucun commentaire:

Enregistrer un commentaire