The road leading towards WPF mastery hit a small bump when it came to data binding and Booleans. I wasn't surprised when my first attempt didn't work, I wasn't even sure what I expected to happen. Normally Boolean fields have some automated behavior. When they are grouped, clicking one button true sets the others in the group false. How does this play with data binding where the value for the field is supposed to be set by the binding? It's enough to make me think if Scott Meyers's were writing a book on this he would have an item titled Prefer CheckBoxes. Checkboxes work with simple Binding to IsChecked just like you'd expect. I do have customers though that insist on Booleans because they like to see both options explicitly shown, so here's one solution:
Edit: Turns out you don't really need the command binding. Just using two properties as described below is sufficient. I'm leaving the code snapshots as they were originally published but you don't need to bind to the Command property and you don't need to write the two commands.
One way to get Booleans to behave with data binding is to bind not just IsChecked but also bind the Command as shown below. This XAML creates two radio buttons labeled To Be and Not To Be. In my final code I added a Mode=OneWay to the binding, but it appeared to work no differently with the default binding.
The ToBe Property is pretty standard except it also sets the property and raises the event for NotToBe. NotToBe is just an automatic property. Both commands will be implemented, but they will both set the ToBe property, one will set it to true and the other will set it to false. Here's the full code example: