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

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -