I'm learning WPF, and am wondering if there's an idiomatic way to create a label that, when clicked, toggles a checkbox or radio button. I was somewhat surprised that the Target
attribute on Label
doesn't do this. I am using the MVVM pattern (with the MVVMFoundation framework.)
views:
28answers:
1
A:
The target property sets the focus to the target element when the labels pre-defined access key is pressed so does not do what you want.
Off the top of my head I would suggest creating a button and using a Style to make it look like a label. You can add 'content' to a checkbox though and this will check the box when clicked.
Leom Burke
2010-06-22 16:28:17