There's a question that was recently asked found here: How can I bind a C# WPF TextBox to different properties depending on a condition?
The question asks about bindings in WPF but makes no mention of MVVM or a ViewModel class. Someone answered
You could do the behind in the callback of the event Checked of your radiobutton..
Something like :
Binding b = new Binding("ShippingAddress");
Which is technically correct, but HighCore's kind of throwing a fit over the fact that bindings are being done in the code-behind when they should, ideally, be done in a ViewModel class, adhering to the MVVM pattern.
In cases like this, should we submit answers involving use of the MVVM pattern even though the user might not have MVVM implemented (as HighCore did), recommend they implement the MVVM pattern, or answer the question as it is (as franssu did)?
I'm in agreement with HighCore that bindings really should be done in a ViewModel, but I don't think it's proper to throw a fit about it when that's not what OP was asking for and the answer submitted does fulfill OP's question.
Edit: I am rescinding my above comments. Should I down-vote an answer that works but promotes bad practices? Given the situation, HighCore's behavior was warrantable. Franssu's answer is viable but promotes bad practices.