title: Changing binding mode in code?
body: <p>I'm making a small application, it's a form that reads from a data source, I want to use it for editing and adding new records.
  so the default binding mode for the textboxes in the form is <code>TwoWay</code> mode, so the user can edit an existing record, but I want to add a Checkbox that when checked, it marks the data in the textboxes as new, and then adding them to the data source, so I need to change the binding mode to <code>OneWay</code>,
  to my knowledge, to do this in code I need to create a new <code>Binding</code> object, that I will have to set properties like <code>Source</code> that doesn't change:</p>
  
  <pre><code>Binding myBinding = new Binding();
  myBinding.Source = ViewModel;
  myBinding.Path = new PropertyPath("SomeString");
  myBinding.Mode = BindingMode.TwoWay;
  myBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
  </code></pre>
  
  <p>So is there a way to change only the Binding mode in code?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>some further explanation of the application:</p>
  
  <p>In the form there's a combobox that is bound to a <code>List&lt;Book&gt;</code>, there  are 3 <code>TextBox</code>s, their <code>Text</code> properties bound to the <code>DataContext</code> object of their container which itself set to the <code>SelectedItem</code> of the <code>Combobox</code>.
  When I added the <code>ReadOnly</code> property as described in the answer, when I check the checkbox I can't change the text in the textboxes.</p>
  
  <p>..</p>
  
  <p>Thanks!</p>