title: WPF Convert Checkbox.IsChecked to int or string 1 or 0
body: <p>So for Winforms its very easy to do this:</p>
  
  <pre><code>streamWriter.WriteLine(this.checkbox1.Checked ? "1" : "0");
  </code></pre>
  
  <p>but how I can do this in WPF ?
  I have to use ".IsChecked" and then i get the Message, that I can't convert bool? into bool.</p>
  
  <p>I just tried:</p>
  
  <pre><code>streamWriter.WriteLine(this.checkbox1.IsChecked ? "1" : "0");
  </code></pre>
  
  <p>which doesn't work. </p>