c# - Binding IsEnabled to IsChecked in WPF -
I have a checkbox and radio buttons. I need binds IsEnabled property in IsChecked property
< Code> & lt; Checkbox X: Name = "check_box" content = "checkbox" IsChecked = "True" /> & lt; RadioButton Content = "Dependent Component" IsChecked = "True" margin = "153,0,0" IsEnabled = "{binding check_box.IsChecked}" />
Is there a way to do this without writing the code?
Yes, you need to use the ElementName () binding:
& lt; Checkbox X: Name = "check_box" content = "checkbox" iischeck = "true" / & gt; & Lt; RadioButton isEnabled = "{binding element name = check_box, path = ihisac, target, netview = false}" ... / ...
Comments
Post a Comment