title: C# WPF set bound checkbox to checked by default
body: <p>I have a checkbox with it's <code>IsChecked</code> property bound already.</p>
  
  <pre><code>&lt;CheckBox
  x:Name="sortChk"
  Content="Sort Variables"
  HorizontalAlignment="Right"
  Margin="10,10,10,5"
  IsChecked="{Binding SortVariables}"
  /&gt;
  </code></pre>
  
  <p>I need it to be checked by default on form load. I've seen that having the <code>IsChecked</code> property set to <code>true</code> will achieve this, but I will lose the binding then.</p>
  
  <p>How do I do this? I'm very new to WPF so forgive me if it's an easy solution.</p>
  
  <p>Edit: I have figured out why the below code was not working on form load, and it's because I did not have it in the Default constructor. Moving it there does the trick. I had a feeling it was something trivial (and stupid on my part). Thanks for the help!</p>
  
  <pre><code>DataCompareVM dcvm = new DataCompareVM(dataset1FullPath, dataset2FullPath);
  dcvm.SortVariables = true;
  DataContext = dcvm;
  </code></pre>